[SDL] SDL & XVideo?

Sam Lantinga slouken at devolution.com
Mon Jan 20 20:48:01 PST 2003


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
> 






More information about the SDL mailing list