Date: Tue, 29 Apr 2003 14:00:54 +0200 To: Benjamin Monate Cc: Sven Luther , lablgtk Subject: Re: lablgtk on windows ... Message-ID: <20030429120054.GA31350 at iliana> References: <20030425114457.GA1558 at iliana> <3EA91DD1.8010709 at lix.polytechnique.fr> <20030425130710.GA2677 at iliana> <3EA93F07.3060504 at lix.polytechnique.fr> <20030425163012.GA1189 at iliana> <3EAA4271.3080006 at lix.polytechnique.fr> <20030429065008.GA2475 at iliana> <3EAE27B3.7000202 at lix.polytechnique.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EAE27B3.7000202 at lix.polytechnique.fr> From: Sven Luther On Tue, Apr 29, 2003 at 09:20:19AM +0200, Benjamin Monate wrote: > Sven Luther wrote: > > >On Sat, Apr 26, 2003 at 10:25:21AM +0200, Benjamin Monate wrote: > > > > > >>What is the output of : > >> > >>pkg-config --libs --cflags gtk+-2.0 > >> > >> > > > >I wrote to the gimp-win32-devel list, and found the problem, i feel > >stupid now, as ever i think. > > > >You need to do : > > > >gcc -mno-cygwin -mms-bitfields `pkg-config --cflags gtk+-2.0` -o > >hello-gtk hello-gtk.c `pkg-config --libs gtk+-2.0` > > > >The libs have to be after the .c file using them, how could i have > >missed that, to long ago that i did some independent C programming > >perhaps. > > > > > Ok. Then you are almost done. > > From: http://www.sybase.com/detail/1,6904,1002374,00.html#windows > > Windows searches for these DLLs in the following order: > > # The directory containing the EXE file that owns the process > # The current directory > # The Windows system directory > # The Windows directory > # The directories listed in the PATH environment variable > > Make your choice among these, and this will work. Notice, i was able to cross compile hello-gtk.c on debian/sid with the following practice : 1) install the mingw32 package. 2) unzip all the packages from the gtkwin32 web page, including libiconv for which you need to move the .dll to lib and the .h to include. 3) set the PKG_CONFIG_PATH variable : export PKG_CONFIG_PATH=/home/luther/download/gtkwin32/lib/pkgconfig 4) launch the build : i586-mingw32msvc-gcc -mno-cygwin -mms-bitfields -o lib/hello-gtk `pkg-config --define-variable=prefix=/home/luther/download/gtkwin32 --cflags gtk+-2.0` hello-gtk.c `pkg-config --define-variable=prefix=/home/luther/download/gtkwin32 --libs gtk+-2.0` notice that i moved the executable in the lib directory, so it would find the .dll files. 5) launched the resulting executable under wine : cd lib; wine ./hello-gtk It runs fine, but there is garbage in the widget, i will need to test it under windows to see if it is wine related or caused by the cross compiling. You can then create an executable tarball : 6) mkdir zipball; cd lib; cp -xav `find . -name \*.dll` ../zipball And zip the resulting directory : 7) cd zipball; zip ../hello-gtk.zip * Now, provided it works fine under windows, we only need a cross-ocamlc compiler. Friendly, Sven Luther