I installed the gcc port (mingw32msvc) under Windows 2000 and am trying to get the SDL library to work. I am just using a basic script to initialize the library and then exit, but when compiling with:
g++ -Wall -o test.exe test.cpp -lsdl
I get the following error:
D:\Programming\GCC\BIN…\lib\gcc-lib\i386-mingw32msvc\2.95.2…\i386-m
ingw32msvc\lib\libmingw32.a(main.o)(.text+0x8e): undefined reference to `WinMain
@16’
From the looks of it, there seems to be something wrong with the gcc libraries, not sdl itself. However I only get this error when attempting to use the sdl lib. Can anyone help?
Travis Surgnier
I think you need to include the “SDLmain” library. It provides WinMain.
Try:
g++ -Wall -o test.exe test.cpp -lsdl -lsdlmain
Hope this helps.
-ArthurFrom: surgie@cfl.rr.com (Travis Surgnier)
Subject: [SDL] Help under Win2k
Date: Sat, 14 Oct 2000 23:22:32 -0400
g++ -Wall -o test.exe test.cpp -lsdl
I get the following error:
D:\Programming\GCC\BIN…\lib\gcc-lib\i386-mingw32msvc\2.95.2…\i386-m
ingw32msvc\lib\libmingw32.a(main.o)(.text+0x8e): undefined reference to `WinMain
@16’
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20001015/0bf33b77/attachment.pgp
Tried that, still getting the same error. I already checked and made sure
that all the lib files were in the right place, and I tried to compile
several of the test programs and one I wrote. They all get the same error.
In case it matters, I’m using SDL 1.1.5 & gcc 2.95.2 msvcrt.
I installed the gcc port (mingw32msvc) under Windows 2000 and am trying to get the SDL library to work. I am just using a basic script to initialize the library and then exit, but when compiling with:
g++ -Wall -o test.exe test.cpp -lsdl
You need to link with the output of “sdl-config --libs”:
-lmingw32 -lSDLmain -lSDL -mwindow
See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software