LDFLAGS in Linux

I am wanting to release a program I wrote using SDL/SDL_Mixer/SDL_ttf as a
binary in Linux. I am running into the issue that on different distro’s
different libraries are installed (like one might use GGI where another use
X11 and yet another use Framebuffer). What LDFLAGS should I be using to
ensure the greatest compatability across the board?

(Obviously this is a non-issue for my win32 and mac os X builds)

Just as a note. I have tried these two setups:
sdlconfig --libs -lSDL_mixer -lSDL_ttf -static
That one I get an error about libc on another machine

sdlconfig --static-libs -lSDL_mixer -lSDL_ttf
This one it is made about GGI on the other box :frowning:

Any help would be great.On Monday 04 October 2004 12:10 am, Nathan Grebowiec wrote:

I am wanting to release a program I wrote using SDL/SDL_Mixer/SDL_ttf as a
binary in Linux. I am running into the issue that on different distro’s
different libraries are installed (like one might use GGI where another use
X11 and yet another use Framebuffer). What LDFLAGS should I be using to
ensure the greatest compatability across the board?

(Obviously this is a non-issue for my win32 and mac os X builds)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I am building an app like this:
g++ sdl-config --cflags sdl-config --libs -lSDL_mixer -lSDL_ttf
-static-libgcc -Wno-deprecated -O2 -o game cboard.cpp clickablockextreme.cpp

Even those I am using --libs from sdl-config it is still showing this in ldd
on the “game” binary:

linux-gate.so.1 => (0xffffe000)
libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0xb7f8b000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7f1f000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f1c000)
libasound.so.2 => /usr/lib/libasound.so.2 (0xb7e4a000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xb7d7d000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xb7d6d000)
libggi.so.2 => /usr/lib/libggi.so.2 (0xb7d61000)
libgii.so.0 => /usr/lib/libgii.so.0 (0xb7d59000)
libgg.so.0 => /usr/lib/libgg.so.0 (0xb7d53000)
libSDL_mixer-1.2.so.0 => /usr/lib/libSDL_mixer-1.2.so.0 (0xb7d15000)
libSDL_ttf-2.0.so.0 => /usr/lib/libSDL_ttf-2.0.so.0 (0xb7d0f000)
libstdc++.so.5
=> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0xb7c46000)
libm.so.6 => /lib/libm.so.6 (0xb7c24000)
libc.so.6 => /lib/libc.so.6 (0xb7b16000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fed000)
libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0xb7b0e000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb7ae5000)
libogg.so.0 => /usr/lib/libogg.so.0 (0xb7ae0000)
libsmpeg-0.4.so.0 => /usr/lib/libsmpeg-0.4.so.0 (0xb7a7f000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7a10000)
libz.so.1 => /lib/libz.so.1 (0xb79ff000)
libgcc_s.so.1
=> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1(0xb79f6000)

Why is ggi and libogg and crap like that showing up?

libSDL is linked to ggi
and libSDL_mixer is linked to ogg

ldd shows all dependancies, including dependancies from libraries that you linked to directly in the first place.

don’t have a cow.

-LIM-

Nathan Grebowiec wrote:> I am building an app like this:

g++ sdl-config --cflags sdl-config --libs -lSDL_mixer -lSDL_ttf
-static-libgcc -Wno-deprecated -O2 -o game cboard.cpp clickablockextreme.cpp

Even those I am using --libs from sdl-config it is still showing this in ldd
on the “game” binary:

linux-gate.so.1 => (0xffffe000)
libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0xb7f8b000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7f1f000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f1c000)
libasound.so.2 => /usr/lib/libasound.so.2 (0xb7e4a000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xb7d7d000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xb7d6d000)
libggi.so.2 => /usr/lib/libggi.so.2 (0xb7d61000)
libgii.so.0 => /usr/lib/libgii.so.0 (0xb7d59000)
libgg.so.0 => /usr/lib/libgg.so.0 (0xb7d53000)
libSDL_mixer-1.2.so.0 => /usr/lib/libSDL_mixer-1.2.so.0 (0xb7d15000)
libSDL_ttf-2.0.so.0 => /usr/lib/libSDL_ttf-2.0.so.0 (0xb7d0f000)
libstdc++.so.5
=> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0xb7c46000)
libm.so.6 => /lib/libm.so.6 (0xb7c24000)
libc.so.6 => /lib/libc.so.6 (0xb7b16000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fed000)
libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0xb7b0e000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb7ae5000)
libogg.so.0 => /usr/lib/libogg.so.0 (0xb7ae0000)
libsmpeg-0.4.so.0 => /usr/lib/libsmpeg-0.4.so.0 (0xb7a7f000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7a10000)
libz.so.1 => /lib/libz.so.1 (0xb79ff000)
libgcc_s.so.1
=> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1(0xb79f6000)

Why is ggi and libogg and crap like that showing up?

Problem is, when I move it to another box it is complaining abou the lack of
ggi on that machine. I only want it to need SDL and let their SDL be linked
against whatever libs they like.On Thursday 07 October 2004 01:57 am, Jonathan Atkins wrote:

libSDL is linked to ggi
and libSDL_mixer is linked to ogg

ldd shows all dependancies, including dependancies from libraries that you
linked to directly in the first place.

don’t have a cow.

-LIM-

Nathan Grebowiec wrote:

I am building an app like this:
g++ sdl-config --cflags sdl-config --libs -lSDL_mixer -lSDL_ttf
-static-libgcc -Wno-deprecated -O2 -o game cboard.cpp
clickablockextreme.cpp

Even those I am using --libs from sdl-config it is still showing this in
ldd on the “game” binary:

linux-gate.so.1 => (0xffffe000)
libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0xb7f8b000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7f1f000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f1c000)
libasound.so.2 => /usr/lib/libasound.so.2 (0xb7e4a000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xb7d7d000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xb7d6d000)
libggi.so.2 => /usr/lib/libggi.so.2 (0xb7d61000)
libgii.so.0 => /usr/lib/libgii.so.0 (0xb7d59000)
libgg.so.0 => /usr/lib/libgg.so.0 (0xb7d53000)
libSDL_mixer-1.2.so.0 => /usr/lib/libSDL_mixer-1.2.so.0
(0xb7d15000) libSDL_ttf-2.0.so.0 => /usr/lib/libSDL_ttf-2.0.so.0
(0xb7d0f000) libstdc++.so.5
=> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0xb7c46000)
libm.so.6 => /lib/libm.so.6 (0xb7c24000)
libc.so.6 => /lib/libc.so.6 (0xb7b16000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fed000)
libvorbisfile.so.3 => /usr/lib/libvorbisfile.so.3 (0xb7b0e000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb7ae5000)
libogg.so.0 => /usr/lib/libogg.so.0 (0xb7ae0000)
libsmpeg-0.4.so.0 => /usr/lib/libsmpeg-0.4.so.0 (0xb7a7f000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7a10000)
libz.so.1 => /lib/libz.so.1 (0xb79ff000)
libgcc_s.so.1
=> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1(0xb79f6000)

Why is ggi and libogg and crap like that showing up?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Make sure you’re not linking your binary against GGI yourself. If you’re
using it, make sure “sdl-config --libs” doesn’t list -lggi.On Thu, Oct 14, 2004 at 06:23:11PM -0500, Nathan Grebowiec wrote:

Problem is, when I move it to another box it is complaining abou the lack of
ggi on that machine. I only want it to need SDL and let their SDL be linked
against whatever libs they like.


Glenn Maynard

Nathan Grebowiec wrote:

Problem is, when I move it to another box it is complaining abou the lack of
ggi on that machine. I only want it to need SDL and let their SDL be linked
against whatever libs they like.

They’re prerequsites for the mode you’ve compiled (and/or have
configued) SDL with. If you don’t desire those bits of functionality,
I’m guessing you’ll have to either:

  1. Have to recompile SDL
  2. statically link SDL (sdl-config --static-libs) (remember SDL is
    LGPL, closed source projects will need to provide object files and
    relinking tools)
  3. Manually disable the automatic dependancy linking with your compiler
    (I’m guessing you’ll need to pass
    –unresolved-symbols=ignore-in-shared-libs + whatever flag supresses
    dependancy linking) - of course your program will crash (I think by
    segfault) if there’s init code that allways calls GGI routines, but then
    GGI would be a prerequisite anyways for your program’s operation.
  4. Filter out GGI in your makefile if it’s being linked using
    sdl-config --libs: $(filter-out -lggi,sdl-config --libs)

or last but not least:

  1. Just install the prereqs.

Just as a note. I have tried these two setups:
sdlconfig --libs -lSDL_mixer -lSDL_ttf -static
That one I get an error about libc on another machine

sdlconfig --static-libs -lSDL_mixer -lSDL_ttf
This one it is made about GGI on the other box :frowning:

This should work:
-lSDL_mixer -lSDL_ttf sdlconfig --libs

-Sam Lantinga, Software Engineer, Blizzard Entertainment