Wierd Error Using C::b In Linux


Pickle

Mega GP Mania
Joined
May 30, 2006
Messages
5,527
Location
Detroit, Michigan
Website
Visit site
Im using the cutting edge open2x libs.
Linker flags: -static -lSDL_mixer -lSDL -lpthread

Build goes fine but I run into these errors:
CODE
/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL.a(SDL_sysloadso.o)||In function `SDL_UnloadObject':|
SDL_sysloadso.c:(.text+0x8)||undefined reference to `dlclose'|
/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL.a(SDL_sysloadso.o)||In function `SDL_LoadFunction':|
SDL_sysloadso.c:(.text+0x20)||undefined reference to `dlsym'|
SDL_sysloadso.c:(.text+0x78)||undefined reference to `dlsym'|
SDL_sysloadso.c:(.text+0x84)||undefined reference to `dlerror'|
/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/libSDL.a(SDL_sysloadso.o)||In function `SDL_LoadObject':|
SDL_sysloadso.c:(.text+0xac)||undefined reference to `dlopen'|
SDL_sysloadso.c:(.text+0xb4)||undefined reference to `dlerror'|


I dont understand why this are here in the first place. I believe they are used to load a lib dynamically. I can place a -ldl at teh end and it takes of it, but then I think its expected the shared lib of glibc to be there with it.
The other thing that is strange is that this seems to occur only with compiling with codeblocks, I did a command line compilation with the same lib and theres no problem.
 
Maybe an incorrect library path? It definitely seems like libdl is missing in the linker (-ldl)

Can you see the command line CB is using?
 
Squidge said:
Maybe an incorrect library path? It definitely seems like libdl is missing in the linker (-ldl)

Can you see the command line CB is using?
Well libdl seems to be found, using -ldl gives this warning:
CODE
warning||Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


Is this nothing to worry about since the only libs (SDL, SDL_mixer) are statically linked?
 
Last edited by a moderator:
Isn't that just saying that you should link with the same version of the dynamic linker loader as the version on the system you are compiling for?

Besides, I'm going to assume that SDL will only ever use functions such as dlopen if it actually needs them, which it shouldn't? I don't have much experience of SDL myself.
 
Scratch that both libs seem to be working ok, I have a seg fault on one app but it may something totally different, as sound works and I can get around some parts of the game.

So its seems the warning has no effect.
 
Sphinxter said:
Looks like you're working too hard, give, `pkg-config`, a try.
Ive never used `pkg-config' before. Im doing anything different than I have in the past. The libs seem to work despite the warning
 
Last edited by a moderator:
Back
Top