Hi all,
I have written a game using SDL for Linux, version 1.2.3. I would
like it to be self-contained so I can make the executable available for
download.
I have the following lines in my makefile
SDL_CFLAGS = $(shell sdl-config --cflags)
SDL_LDFLAGS = $(shell sdl-config --static-libs)
which produces the following output. It compiles just fine.
-I/usr/include/SDL -D_REENTRANT
-L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lm -L/usr/X11R6/lib
-lX11 -lXext -lXxf86vm -lXxf86dga -lXv -lXinerama -ldl
When I tried to run the executable on a different machine, I got this
error:
./arena: error while loading shared libraries: libstdc++.so.5: cannot
open shared object file: No such file or directory
So I went back to my makefile and added the -static g++ command line
option to try and link in libstdc++. I got the following link errors:
fight.o(.text+0x4d): In function fight_scene(int)': : undefined reference to
SDL_RWFromFile’
fight.o(.text+0x56): In function fight_scene(int)': : undefined reference to
SDL_LoadBMP_RW’
and warning
/usr/lib/libSDL.a(SDL_loadso.o)(.text+0x1b): In function `SDL_LoadObject’:
: warning: Using ‘dlopen’ in statically linked applications requires at
runtime the shared libraries from the glibc version used for linking
Any suggestions on how to fix this?
Thanks
Niki Thornock