From: Tim H. <tt...@on...> - 2002-07-13 11:07:13
|
On Sat, 13 Jul 2002 12:07:16 +0800 "Luke Dunstan" <cod...@ho...> wrote: > > ----- Original Message ----- > From: "Tim Hentenaar" <tt...@on...> > To: <min...@li...> > Sent: Saturday, July 13, 2002 10:39 AM > Subject: [Mingw-users] libmingw32.a(main.o)(.text+0x8e): undefined reference > to `WinMain@16' > > > > > > Hello everyone, > > > > I was hoping someone could help me with a slight problem i've been > having... > > > > I wrote a program that compiles fine under linux and cygwin (on Win98SE), > but when i specify -mno-cygwin or try to compile it on my local mingw build, > I get the following: > > > > [root@localhost arnold]# > g++ -O2 -g -I/usr/include/win32 -I/usr/cross-tools/include/g++-3 -L/usr/cros > s-tools/i386-mingw32msvc/lib -L/usr/lib/mingw32 -L. -L/usr/cross-tools/lib/g > cc-lib/i386-mingw32msvc/2.95.2 -L/usr/cross-tools/i386-mingw32msvc/lib -o > arnold-bin.exe arnold.cpp -lSDL -lSDL_mixer > > > > /usr/cross-tools/i386-mingw32msvc/lib/libmingw32.a(main.o)(.text+0x8e): > undefined reference to `WinMain@16' > > > > If you look in the 'sdl-config' script you will see that you need to specify > '-lmingw32 -lSDLmain -lSDL -mwindows ...' so that the WinMain() function can > be found in the libSDLmain.a library. SDL headers contain '#define main > SDL_main' so your 'main' function isn't really called 'main'. BTW, linking > libmingw32.a more than once does not cause problems. > > > -- > > Tim Hentenaar > > > > Systems Administrator / Programmer > > Xodian Network > > http://xodian.net > > > > Luke Dunstan > Thanks for the info. it worked. -- Tim Hentenaar Systems Administrator / Programmer Xodian Network http://xodian.net |