From kohnicho@comp.nus.edu.sg Thu Apr 27 08:29:43 2000 Date: Thu, 27 Apr 2000 15:39:59 +0800 (SST) From: Nicholas Lewin-Koh To: Wolfgang Glas Cc: feiguin@magnet.fsu.edu, adrian@ifir.edu.ar Subject: GtkExtra on win32 Well I went ahead and compiled the wole thing as a dll, I am attaching the makefile if you are interested. However 3 files do not compile (using the mingw32 compiler). The files are gtkiconfilesel.c gtkdirtree.c gtkfilelist.c the first 2 have some conflicts, redifining some things (that was my earlier message), the 3rd gtkfilelist includes fnmatch.h which is specific to glibc. There is word however on the mingw32 list that a glibc port is in the works (which may solve some other problems). After I compiled the dll, I tried the test programs testgtksheet and testgtkfont got as far as the console windows and then printed a lot of Gtk-Critcal invalid cast from (NULL) pointer to 'GtkEntry' testgtkplot worked sortof, but not well and crashed easily. Is this due to the gtklayout problem? anyway here is my makefileand if I get some more time I may actually start to do some debugging. Nicholas Make file ----------------------------------- # # Makefile for Cygwin. # CC = gcc CXX = c++ DEBUG = -g -Wall #-O2 CXXFLAGS = $(DEBUG) CFLAGS = $(DEBUG) CPPFLAGS = -I. AS = as DLLTOOL = dlltool DLLWRAP = dllwrap exeext = .exe # # Various targets to build. # DLL_NAME = GtkExtra.dll DLL_EXP_LIB = libGtkExtra.a DLL_EXP_DEF = GtkExtra.def #TESTPROGS = usedll$(exeext) all: $(DLL_NAME) $(TESTPROGS) # # sources, objects, etc. # SRCS = gtkbordercombo.c gtkfontcombo.c gtkplotlayout.c \ gtkcheckitem.c gtkplotpc.c \ gtkcolorcombo.c gtkiconlist.c gtkplotprint.c\ gtkcombobox.c gtkitementry.c gtkplotps.c\ gtkplot.c gtkpsfont.c\ gtkplotcanvas.c gtksheet.c #gtkiconfilesel.c gtkdirtree.c gtkfilelist.c # $(wildcard *.cc *.c) OBJS = $(SRCS:.cc=.o) OBJS := $(OBJS:.c=.o) # # DLL related variables. These are used when building the DLL. See later. # #Includes INC= -I . -I d:/Nicholas/gtk-test/gtk-win/glib\ -I d:/Nicholas/gtk-test/gtk-win/glib/gmodule \ -I d:/Nicholas/gtk-test/gtk-win/gtk+/gdk/win32 \ -I d:/Nicholas/gtk-test/gtk-win/gtk+/gdk \ -I d:/Nicholas/gtk-test/gtk-win/gtk+ \ LIB= # Must define BUILDING_DLL when building the DLL. Otherwise import/exports # will not work correctly. See dllclass.h for more info. DLL_CFLAGS = -DBUILDING_DLL=1 # The default entry point defined by dllwrap; the default user callback # is DllMain, and there is stub in dllinit.c. DLL_LDFLAGS = # any extra libraries that your DLL may depend on. DLL_LDLIBS = -L d:/Nicholas/gtk-test/gtk-win/gtk+/gdk -lgdk-1.3 \ -L d:/Nicholas/gtk-test/gtk-win/gtk+/gtk -lgtk-1.3 \ -L d:/Nicholas/gtk-test/gtk-win/glib -lglib-1.3 -lm DLL_SRCS = dllinit.c gtkbordercombo.c gtkfontcombo.c gtkplotlayout.c \ gtkcheckitem.c gtkplotpc.c \ gtkcolorcombo.c gtkiconlist.c gtkplotprint.c\ gtkcombobox.c gtkitementry.c gtkplotps.c\ gtkplot.c gtkpsfont.c\ gtkplotcanvas.c gtksheet.c #gtkiconfilesel.c gtkdirtree.c gtkfilelist.c DLL_OBJS = $(DLL_SRCS:.cc=.o) DLL_OBJS := $(DLL_OBJS:.c=.o) ### # # Making DLL # ### # # Note that we let dllwrap create both the DEF and IMPORT library in # one shot. No need to run dlltool anymore. # DLLWRAP_FLAGS = --export-all --output-def $(DLL_EXP_DEF) \ --implib $(DLL_EXP_LIB) \ --driver-name $(CC) $(DLL_NAME) $(DLL_EXP_DEF) $(DLL_EXP_LIB): $(DLL_OBJS) $(DLLWRAP) $(DLLWRAP_FLAGS) -o $(DLL_NAME) \ $(DLL_OBJS) $(DLL_LDFLAGS) $(DLL_LDLIBS) # # making exec # #usedll$(exeext): usedll.o $(DLL_EXP_LIB) # $(CC) -o $@ $(CFLAGS) $(LDFLAGS) usedll.o -L./ -lcdll # # dependencies. # dllinit.o: dllinit.c # # default rules for building DLL objects. Note that client programs (ie., # the ones that *use* the DLL) have to be compiled without the DLL_CFLAGS # flags. # .cc.o: $(CXX) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< .c.o: $(CC) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(INC) -o $@ $< clean: -rm -f $(OBJS) $(DLL_NAME) $(DLL_EXP_LIB) $(DLL_EXP_DEF) $(TESTPROGS)