[SDL] Makefile

Anthony Lewis tony at tonyandpaige.com
Tue Jan 7 20:00:01 PST 2003


Also, make sure you have the XFree86-devel package installed.  I know it 
sounds crazy, but that's what it looks like to me.

Mark K. Kim wrote:

>I've also gotten those same errors after upgrading to the latest
>SDL-devel.  I got Mandrake 8.1.  It looks like you got Mandrake 9.0.
>Perhaps it's a Mandrake thing.  Try adding the -lGL option, like this:
>
> test: main.cpp
>       g++ `sdl-config --cflags` -c main.cpp
>       g++ main.o -o test `sdl-config --libs` -L/usr/X11R6/lib -lGL
>
>Please let me know how that goes.  I'm curious.
>
>-Mark
>
>
>On 7 Jan 2003, Micah Lee wrote:
>
>  
>
>>Now my Makefile looks like this:
>>
>>-----------------------------------------------
>>test: main.cpp
>>	g++ `sdl-config --cflags` -c main.cpp
>>	g++ main.o `sdl-config --libs` -o test
>>-----------------------------------------------
>>
>>And it still gives me errors:
>>
>>-----------------------------------------------
>>[micah at mandrake9 test]$ make
>>g++ `sdl-config --cflags` -c main.cpp
>>g++ main.o `sdl-config --libs` -o test
>>/usr/lib/libSDL.a(SDL_x11video.lo): In function `X11_Available':
>>SDL_x11video.lo(.text+0x1d): undefined reference to `XOpenDisplay'
>>SDL_x11video.lo(.text+0x2f): undefined reference to `XCloseDisplay'
>>/usr/lib/libSDL.a(SDL_x11video.lo): In function `create_aux_windows':
>>SDL_x11video.lo(.text+0x453): undefined reference to `XDestroyWindow'
>>SDL_x11video.lo(.text+0x4ff): undefined reference to `XCreateWindow'
>>SDL_x11video.lo(.text+0x528): undefined reference to `XSelectInput'
>>SDL_x11video.lo(.text+0x583): undefined reference to `XInternAtom'
>>SDL_x11video.lo(.text+0x5da): undefined reference to `XSendEvent'
>>SDL_x11video.lo(.text+0x5ff): undefined reference to `XGetWMHints'
>>SDL_x11video.lo(.text+0x61b): undefined reference to `XGetWMName'
>>SDL_x11video.lo(.text+0x638): undefined reference to `XGetWMIconName'
>>SDL_x11video.lo(.text+0x64e): undefined reference to `XDestroyWindow'
>>SDL_x11video.lo(.text+0x6a0): undefined reference to `XCreateWindow'
>>SDL_x11video.lo(.text+0x6b7): undefined reference to `XAllocWMHints'
>>-----------------------------------------------
>>
>>Of course, using sdl-config is definitely good advice.  I just realized
>>that all of the errors have to do with video mode in X.  If I comment
>>out everything except SDL_Init(0) and SDL_Quit() and stick an
>>SDL_Delay(1000) in the middle and try making it, it still gives me all
>>the same errors, if that helps.
>>
>>On Tue, 2003-01-07 at 15:28, Mika Halttunen wrote:
>>    
>>
>>>Micah Lee wrote:
>>>      
>>>
>>>>----------------------------------------------
>>>>test: main.cpp
>>>>	gcc -c main.cpp
>>>>	gcc main.o -lSDL -o test
>>>>----------------------------------------------
>>>>
>>>>When I run make on this, it shows me all kinds of stuff, starting with....
>>>>        
>>>>
>>>I'm not sure if this is the solution to your problem, but IMO you should
>>>use "sdl-config" script when compiling/linking. Something like:
>>>
>>>	gcc 'sdl-config --cflags' -c main.cpp
>>>	gcc main.o 'sdl-config --libs' -o test
>>>
>>>Notice the '  are backticks, not ' quotes.
>>>But as I said, this is probably unrelevant to your problem.
>>>
>>>--
>>>Mika Halttunen
>>>lsoft at mbnet.fi
>>>
>>>
>>>_______________________________________________
>>>SDL mailing list
>>>SDL at libsdl.org
>>>http://www.libsdl.org/mailman/listinfo/sdl
>>>
>>>      
>>>
>>
>>_______________________________________________
>>SDL mailing list
>>SDL at libsdl.org
>>http://www.libsdl.org/mailman/listinfo/sdl
>>
>>    
>>
>
>  
>






More information about the SDL mailing list