Getting started on Linux

This must be a dead-simple thing but I didn’t find a cure on the SDL
website.

I started trying SDL and made a little ‘Alive.cpp’ app. Works fine on Win32
(Visual C++ 6.0).
When trying to compile the same on Linux, I get a lot of X11 compilation
errors.

Here’s the compile command:
gcc -o out/alive Alive.cpp sdl-config --cflags --libs

Which translates into:
gcc -o out/alive Alive.cpp -I/usr/include/SDL -D_REENTRANT
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread

And here’s the output (beginning of it):
/usr/lib/libSDL.a(SDL_x11video.lo): In function X11_Available': SDL_x11video.lo(.text+0x1d): undefined reference toXOpenDisplay’
SDL_x11video.lo(.text+0x2f): undefined reference to XCloseDisplay' /usr/lib/libSDL.a(SDL_x11video.lo): In functioncreate_aux_windows’:
SDL_x11video.lo(.text+0x453): undefined reference to
XDestroyWindow' SDL_x11video.lo(.text+0x4ff): undefined reference toXCreateWindow’
SDL_x11video.lo(.text+0x528): undefined reference to XSelectInput' SDL_x11video.lo(.text+0x583): undefined reference toXInternAtom’
SDL_x11video.lo(.text+0x5da): undefined reference to XSendEvent' SDL_x11video.lo(.text+0x5ff): undefined reference toXGetWMHints’
SDL_x11video.lo(.text+0x61b): undefined reference to `XGetWMName’

What’s the missing piece - some X11 development rpm? Which one - does it
matter.

Here’s the output from various sdl tools:

$ which sdl-config
/usr/bin/sdl-config

$ sdl-config --version
1.2.5

$ locate libSDL
/usr/lib/libSDL-1.1.so.0
/usr/lib/libSDL-1.1.so.0.3.1
/usr/lib/libSDL.a
/usr/lib/libSDL.la
/usr/lib/libSDL.so
/usr/lib/libSDLmain.a

$ tail config.log
tail: config.log: No such file or directory

Thanks for any help!

  • Asko###########################################
    This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.

Asko Kauppi:

What’s the missing piece - some X11 development rpm? Which one - does it
matter.

I had similar problems… SDL 1.2.5 seemed to have some sort of problems with
X11 (and older version of ALSA) that SDL 1.2.4 was not having.
Eventually, SDL 1.2.5 worked again after a X11 upgrade, but i messed the
whole thing, so i can’t track it down.
Try to upgrade X.
Hope it helps.

Francesco Orsenigo, Xarvh Project
http://freeweb.lombardiacom.it/xarvh/

This must be a dead-simple thing but I didn’t find a cure on the SDL
website.

I started trying SDL and made a little ‘Alive.cpp’ app. Works fine on Win32
(Visual C++ 6.0).
When trying to compile the same on Linux, I get a lot of X11 compilation
errors.

Here’s the compile command:
gcc -o out/alive Alive.cpp sdl-config --cflags --libs
try here sdl-config --cflags --static-libsOn Thu, Nov 28, 2002 at 04:47:33PM +0200, Asko Kauppi wrote:

Which translates into:
gcc -o out/alive Alive.cpp -I/usr/include/SDL -D_REENTRANT
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread


Sergey Ulanov
sulanov at land.ru