• Advertisement
Sign in to follow this  

AntTweakBar error while loading shared libraries on Linux

This topic is 1146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi

it doesn't find libAntTweakBar.so.1 even if I give rpath . and have it in the same directory:

 

Invoking: GCC C++ Linker
g++ -Wl,-rpath=. -L/home/michael/CPP64/AntTweakBar/lib -shared -o "lin.xpl"  ./main.o   -lopenal -lAntTweakBar -lcurl -lSDL -lGL
Finished building target: lin.xpl

 

 

michael@michael-ubuntu:~/X-Plane_10/Aircraft/General Aviation/MyPlane/plugins/myplane/64$ ldd lin.xpl
    linux-vdso.so.1 =>  (0x00007fffec1fe000)
    libopenal.so.1 => /usr/lib/x86_64-linux-gnu/libopenal.so.1 (0x00007f2c687b7000)
    libAntTweakBar.so.1 => ./libAntTweakBar.so.1 (0x00007f2c6851b000)

...

 

but my x-plane plugin loads fine if I do:

 

sudo cp libAnt* /usr/local/lib
sudo ldconfig -v

 

Why and how to use libAntTweakBar from my app directory?

Many thanks

 

Share this post


Link to post
Share on other sites
Advertisement
This is normal UNIXy behavior. You can use RPATH to change the behavior, or dynamically lost the library using dlopen.

RPATH is usually avoided. If you need to install AntTweakBar locally instead of using system packages (system ones are highly preferable), dynamic loading is recommended.

Share this post


Link to post
Share on other sites

Well I've tested it a while ago with sdl 1.2 (removed from /usr/*) and it loaded the libs from my app directory directly. So why doesn't rpath use anttweakbar likewise? Even ldd finds them.

Seems I need static linking?

Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement