Cannot statically link SDL (linux, gcc)

I try to build project and link SDL statically and OpenGL and other libs dynamically. My link line is:

g++ <a list of my .o>? -L/usr/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib,-Bstatic -lSDL -lSDL_image -Wl,-Bdynamic -lGL -lGLU -ljpeg -lGLEW -o AnKi.bin

The problem is that I get undefined references from ALSA functions.

What am I doing wrong?
Thanks in advance_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

“Panos C. C.” writes:

I try to build project and link SDL statically and OpenGL and other libs dynamically. My link line is:

g++ <a list of my .o>? -L/usr/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib,-Bstatic -lSDL -lSDL_image -Wl,-Bdynamic -lGL -lGLU -ljpeg -lGLEW -o AnKi.bin

The problem is that I get undefined references from ALSA functions.

Inspect the output of the “sdl-config --libs” command and compare it
with your link line.–
Alberto

The “sdl-config --libs” gives me “-L/usr/lib -lSDL” which is already there and “sdl-config --static-libs” gives “-L/usr/lib -lSDL -lpthread” which is already there too.

I mean I’ve tried dozens of combinations but I cannot link SDL statically. Its so frustrating________________________________
Panos (GODlike) C. C.
http://www.ancient-ritual.com


Hotmail: Trusted email with Microsoft?s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

Did you try the -static option to gcc?On Mon, 2010-02-22 at 14:03 +0200, Panos C. C. wrote:

The “sdl-config --libs” gives me “-L/usr/lib -lSDL” which is already there and “sdl-config --static-libs” gives “-L/usr/lib -lSDL -lpthread” which is already there too.

I mean I’ve tried dozens of combinations but I cannot link SDL statically. Its so frustrating

I did try -static but it searches for static only libs and OpenGL is not static. I want to combine static and dynamic linking________________________________
Panos (GODlike) C. C.
http://www.ancient-ritual.com


Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010

Michael Farrell writes:> On Mon, 2010-02-22 at 14:03 +0200, Panos C. C. wrote:

The “sdl-config --libs” gives me “-L/usr/lib -lSDL” which is already there and “sdl-config --static-libs” gives “-L/usr/lib -lSDL -lpthread” which is already there too.

I mean I’ve tried dozens of combinations but I cannot link SDL statically. Its so frustrating

Oops. I skipped the “static” part. Then try to link with libasound
dinamically or statically. I suspect that sdl-config --static-libs
misses that.


Alberto