On January 10, 2003 01:14 am, Glen Kaukola wrote:
All they have is C++ code. So maybe I should go with my original plan of compiling stuff with visual studio and seeing if it runs under wine. Or do you have any other suggestions?
Compiling stuff with visual studio is a first step. But it should be very simple to do a Makefile for the examples, how many files do you have in one example?
Here is an example Makefile that you can use under mingw: (let me know if it doesn't work, I just typed it inline here, no testing)
--------------- cut here ------------------------<
CC = gcc # change this to winegcc under Wine CXX = g++ # change this to wineg++ under Wine RC = windres # change this to wrc under Wine
# There six lines will change between examples TARGET = sample1.exe #name of the executable SRCS = file1.cpp file2.cpp ... RSRC = res1.rc res2.rc ...
# If you need to add defines, add them to CPPFLAGS # CPPFLAGS, INCDIRS, LIBDIRS, and LIBS may change between examples CPPFLAGS = # add stuff here like -D_WIN32_IE=0x0400 CFLAGS = -mno-cygwin -W -Wall -g -gstabs+ -fno-exceptions -fno-rtti LDFLAGS = -mno-cygwin -mwindows INCDIRS = # add stuff there like -I../include LIBDIRS = # add stuff like -L../lib LIBS = -lcomctl32 # we'll need to add more libs in here for sure
OBJ = $(SRCS:.c=.o) $(RSRC:.c=.o)
%.o : %.rc $(RC) $(CPPFLAGS) $< $@
%.o : %.cpp $(CXX) $(CFLAGS) $(CPPFLAGS) $(INCDIRS) -c -o $@ $<
%.o : %.c $(CC) $(CFLAGS) $(CPPFLAGS) $(INCDIRS) -c -o $@ $<
$(TARGET): $(OBJS) $(CXX) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@ $(OBJS)
# A few nice targets
all: $(TARGET)
clean: rm -f $(TARGET) $(OBJS)
--------------- cut here ------------------------<
It's not hard, just look in the .dsp project to see what you need to put in these variables.
Dimitrie O. Paun wrote:
Compiling stuff with visual studio is a first step. But it should be very simple to do a Makefile for the examples, how many files do you have in one example?
Here is an example Makefile that you can use under mingw: (let me know if it doesn't work, I just typed it inline here, no testing)
Well I know at least the basics of Makefiles already, on linux anyhow. I'm thinking I can easily come up with one for each of the sample programs in my books. I guess I was confused by the suggestion to use the Makefiles from my book, thinking that there would be something special about them. I'm not very familiar with windows development, so it's an honest mistake. It seems studio doesn't even use makefiles though. By the way, I feel terrible about it, hehe, but I went out and got visual c++. So I guess I'll be testing any executables I produce with it as well as going the other route with mingw. So now unless I have any unforseen problems, you probably won't hear from me for a while until I find something that doesn't work.
Thanks for taking the time to help me get started.