[SDL] Question on SDL on mingw32

Ping Lek pinglek at hotmail.com
Thu Jul 19 23:22:35 PDT 2007


Sam Lantinga <slouken <at> devolution.com> writes:

> 
> > COMPILE
> > -------
> > $ gcc -I/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main -lmingw32 -
L/local/l
> > ib -lSDLmain -lSDL -mwindows SDL_wave4.c -o SDL_wave4
> 
> Hey, I added this to the FAQ:
> http://www.libsdl.org/faq.php?action=listentries&category=4#88
> 
> When you're compiling with gcc, you need to make sure the output of sdl-
config follows your source file on
> the command line:
> gcc -o test test.c `sdl-config --cflags --libs`
> 
> See ya!
> 	-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
> 

Sam,

Thanks for your information, I tried it earlier and it worked.  Went ahead and 
found that if I had given the source file and the output file as the first 2 
arguments for gcc, I wouldn't have the problem:

$ gcc SDL_wave4.c -o SDL_wave4 -I/local/include/SDL -D_GNU_SOURCE=1 -
Dmain=SDL_main -lmingw32 -L/local/lib -lSDLmain -lSDL -mwindows

I'm pretty new to gcc ... and the "gcc --help" indicated "gcc <options> 
files", which made me presume that all input files should be given as last 
argument.  (But why this doesn't happen in my Linux box? Hmmm ....)

Thanks again!
ping-lek




More information about the SDL mailing list