From: David B. <db...@ta...> - 2006-10-13 02:41:22
|
Hi Yves, I'm trying to cross compile tuxmath according to your advice but have not y= et=20 succeeded - get an error "undefined reference to `_WinMain@16'". > If you want to cross compile it yourself: > 1) install mingw32 on linux (apt-get install mingw32 for me). No problem. > 2) install precompiled dev files (lib and includes) for SDL, SDL-image > and SDL-mixer in the $target directory (look into the cross-configure.sh= ). I'm assuming I need the files precompiled for win32. For SDL itself, I hav= e a=20 choice of files intended for VC (SDL.dll and friends) or mingw32 (libSDL.dll.a, etc). For SDL_image and SDL_mixer, there only seem to be th= e=20 dll flavor. =20 I've tried both types of SDL libs and get the same error either way.=20 Here is a listing of my cross-tools lib directory: dbruce@debian:/usr/local/cross-tools/i586-mingw32msvc/lib$ ls SDL.dll SDL_image.lib SDLmain.lib libpng12.dll smpeg.dll =20 zlib1.dll SDL.lib SDL_mixer.dll jpeg.dll libtiff.dll vorbis.dll SDL_image.dll SDL_mixer.lib libgw32c.a ogg.dll vorbisfile.dll > 3) install libgw32c (the dev file): > http://gnuwin32.sourceforge.net/packages/libgw32c.htm in the same > directory. 4) cross-configure.sh with --with-sdl-prefix option > 5) cross-make.sh The error with ./cross-make.sh: dbruce@debian:~/tuxmath-crossbuild/tuxmath/trunk$ ./cross-make.sh make all-recursive make[1]: Entering directory `/home/dbruce/tuxmath-crossbuild/tuxmath/trunk' Making all in src make[2]: Entering directory=20 `/home/dbruce/tuxmath-crossbuild/tuxmath/trunk/src' i586-mingw32msvc-gcc -Wall -g -DDATA_PREFIX=3D\"data\" -DDEBUG -DVERSION=3D= \"tuxmath-0.96\" -DSOUND -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=3D1 -D_REE= NTRANT -D__GW32__ -L/usr/local/cross-tools/i586-mingw32msvc/lib -o=20 tuxmath.exe tuxmath.o setup.o title.o game.o options.o credits.o playsound= =2Eo=20 mathcards.o=20 fileops.o -L/usr/lib -lSDL -lSDL_image -lSDL_mixer -lgw32c -luuid -lole32 = =2Dlwsock32 -mwindows /usr/lib/gcc/i586-mingw32msvc/3.4.5/../../../../i586-mingw32msvc/lib/libmin= gw32.a(main.o):=20 undefined reference to `_WinMain@16' collect2: ld returned 1 exit status make[2]: *** [tuxmath.exe] Error 1 make[2]: Leaving directory `/home/dbruce/tuxmath-crossbuild/tuxmath/trunk/s= rc' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/dbruce/tuxmath-crossbuild/tuxmath/trunk' make: *** [all] Error 2 =46rom what I can tell through google, "_WinMain@16'" refers to a function= in=20 SDLmain.lib (or libSDLmain.a) that I need to link using "-lSDLmain". Any=20 hints as to how to get this working? (I am using the current tuxmath source in svn - revision 48) Thanks for any help, =2D-=20 David Bruce |