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.