ldd dependencies - linux

I'm compiling 2 shared libraries ("A", "B") under Linux (Ubuntu 11)
The lib "B" is using exported function from lib "A" (linked statically with -lA)
But when I'm running ldd on "B" I just have*
linux-gate.so.1 => (0x004c0000) libc.so.6
/lib/i386-linux-gnu/libc.so.6 (0x00abf000)
/lib/ld-linux.so.2 (0x00679000)
I cannot see my "A" dependency !?
Strange, I was (almost) pretty sure ldd used to display ALL static dependencies !?

From man ldd
ldd - print shared library dependencies
There is no run-time dependencies for static libraries, since they were linked statically,

You need to link dynamically libA.so into libB.so, that is to build libB.so with something like
gcc -shared -o libB.so B*.pic.o -lA
(assuming no libA.a exist, only a libA.so)
And then you could use ldd libB.so to check that it does link libA.so
Look for example into most GUI libraries like /usr/lib/libQtGui.so.4 or /usr/lib/libgtk-3.so, e.g.
% ldd /usr/lib/libgtk-3.so
linux-vdso.so.1 => (0x00007fffe4cef000)
libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007f5a69c3b000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f5a69a00000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f5a696c0000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f5a694be000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f5a692bc000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f5a690b5000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f5a68e92000)
libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007f5a68c8a000)
libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007f5a689c9000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f5a687aa000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f5a68465000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f5a68238000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f5a67feb000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f5a67d4d000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f5a67b17000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f5a678c6000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f5a676c3000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f5a674bd000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5a672b5000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f5a66fbe000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5a66d3b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5a66b1f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5a6679b000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f5a66587000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f5a66385000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f5a66176000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f5a65f6d000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f5a65d63000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f5a65b46000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5a65942000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f5a656ba000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f5a65494000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f5a65291000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f5a65087000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f5a64e7d000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f5a64c65000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f5a64a44000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f5a6482e000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f5a64604000)
libffi.so.5 => /usr/lib/x86_64-linux-gnu/libffi.so.5 (0x00007f5a643f7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5a6a50e000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f5a641ba000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f5a63fb7000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f5a63db1000)

Related

Tell to linux binary not load specific shared libraries

I have a problem with shared libraries, Command show warning each time when it run's,
PHP Warning: PHP Startup: Unable to load dynamic library 'xxxx.so'
whereas it run fine with not issues, i want to remove libcrypto.so.1.0.0 => not found this line from list so that it will not look for this shared library.
ldd ...php/ext/curl.so
linux-vdso.so.1 => (0x00007ffe1a65f000)
libcurl.so.4 => /lib/libcurl.so.4 (0x00007fb9fdd8f000)
libssl.so.1.0.0 => /lib/libssl.so.1.0.0 (0x00007fb9fdb1f000)
libcrypto.so.1.0.0 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007fb9fd751000)
libssl.so.1.1 => /lib/libssl.so.1.1 (0x00007fb9fd4c0000)
libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x00007fb9fcff7000)
libldap-2.4.so.2 => /lib/libldap-2.4.so.2 (0x00007fb9fcdb5000)
liblber-2.4.so.2 => /lib/liblber-2.4.so.2 (0x00007fb9fcba8000)
libz.so.1 => /lib/libz.so.1 (0x00007fb9fc990000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb9fc774000)
libcrypto.so.1.0.0 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb9fc570000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb9fe22e000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fb9fc356000)
libcrypto.so.1.0.0 => not found
what to do ?

ldd cannot find library

I'm having problems with a library, which cannot be found, despite being there in proper version.
ldd /lib/libQt5Core.so
linux-gate.so.1 (0xb77ac000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb71d4000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xb71b9000)
libicui18n.so.57 => /lib/i386-linux-gnu/libicui18n.so.57 (0xb6f20000)
libicuuc.so.57 => /lib/i386-linux-gnu/libicuuc.so.57 (0xb6d74000)
libicudata.so.57 => /lib/i386-linux-gnu/libicudata.so.57 (0xb54f6000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb54f1000)
libgthread-2.0.so.0 => /lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb54ee000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb53c0000)
libstdc++.so.6 => /lib/i386-linux-gnu/libstdc++.so.6 (0xb5242000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb5140000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb5120000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb4f47000)
/lib/ld-linux.so.2 (0xb77af000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb4ed0000)
The libQt5Core library is in /lib and has all dependencies met. But if something wishes to use it:
ldd /lib/libQt5Concurrent.so
linux-gate.so.1 (0xb7735000)
libQt5Core.so.5 => not found
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb76f1000)
libstdc++.so.6 => /lib/i386-linux-gnu/libstdc++.so.6 (0xb7573000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7471000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7453000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb727a000)
/lib/ld-linux.so.2 (0xb7738000)
libQt5Core is no longer found. Both libs have the same architecture. Does anyone have any ideas?
Turns out it's an issue with kernel being too old. On newer ones it works fine.

libpulse.so.0: cannot open shared object file: No such file or directory

I am getting this error when trying to install a server.
libpulse.so.0: cannot open shared object file: No such file or directory
I run an ldd and there is the libpulse.so.0 but the script don't work with that
root#mas:~/Velneo-vServer# sudo sh ./vServer.sh -i
./vServer: error while loading shared libraries: libpulse.so.0: cannot open shared object file: No such file or directory
root#mas:~/Velneo-vServer# ldd `which pulseaudio`
linux-vdso.so.1 => (0x00007ffe903d8000)
libpulsecore-4.0.so => /usr/lib/libpulsecore-4.0.so (0x00007f2304ae1000)
libpulsecommon-4.0.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-4.0.so (0x00007f230487a000)
libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f2304630000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f2304426000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f23041e1000)
libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f2303fdb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2303dbd000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2303bb5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f23039b0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f23036aa000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f23032e5000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f23030e2000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f2302dad000)
libsamplerate.so.0 => /usr/lib/x86_64-linux-gnu/libsamplerate.so.0 (0x00007f2302a41000)
libspeexdsp.so.1 => /usr/lib/x86_64-linux-gnu/libspeexdsp.so.1 (0x00007f230282d000)
libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f23025c5000)
liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f2302343000)
libtdb.so.1 => /usr/lib/x86_64-linux-gnu/libtdb.so.1 (0x00007f2302130000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2304d7b000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f2301f11000)
libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f2301d07000)
libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f2301b00000)
libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f23018f5000)
libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f23016c3000)
libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f23011f4000)
libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f2300fc7000)
libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f2300dbd000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f2300bb9000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f23009b3000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f2300798000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f230057d000)
root#mas:~/Velneo-vServer#
I installed lib32z1 lib32ncurses5 lib32bz2-1.0 but still have the message, as you can see,
the libpulse.so.0 is there, but in another folder, I created a symlink but gives me another error,
any idea of how can I solve this
the output of ldd ./vServer
root#mas:~/Velneo-vServer# ldd ./vServer
linux-gate.so.1 => (0xb778c000)
libVCLServer.so.7 (0xb7733000)
libVCLRun.so.7 (0xb7666000)
libVCLBasica.so.7 (0xb722e000)
libQt5Core.so.5 (0xb6ce6000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb6bf5000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb6bd8000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb6a28000)
libQt5Network.so.5 (0xb68c0000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb68a4000)
libQt5Gui.so.5 (0xb62f4000)
libQt5Svg.so.5 (0xb629d000)
libQt5PrintSupport.so.5 (0xb6231000)
libQt5Widgets.so.5 (0xb5bb2000)
libQt5Multimedia.so.5 (0xb5ad4000)
libQt5Sql.so.5 (0xb5a93000)
libQt5Script.so.5 (0xb583f000)
libQt5ScriptTools.so.5 (0xb578a000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb5744000)
libicui18n.so.53 => /root/Velneo-vServer/libicui18n.so.53 (0xb54ed000)
libicuuc.so.53 => /root/Velneo-vServer/libicuuc.so.53 (0xb536e000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb5368000)
libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xb5365000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb535c000)
libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xb5250000)
/lib/ld-linux.so.2 (0xb778d000)
libGL.so.1 => /usr/lib/i386-linux-gnu/mesa/libGL.so.1 (0xb51f0000)
libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xb519d000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xb5069000)
libpulse.so.0 => not found
libicudata.so.53 => /root/Velneo-vServer/libicudata.so.53 (0xb3be0000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb3ba1000)
libglapi.so.0 => /usr/lib/i386-linux-gnu/libglapi.so.0 (0xb3b89000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xb3b76000)
libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xb3b72000)
libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xb3b6c000)
libX11-xcb.so.1 => /usr/lib/i386-linux-gnu/libX11-xcb.so.1 (0xb3b68000)
libxcb-glx.so.0 => /usr/lib/i386-linux-gnu/libxcb-glx.so.0 (0xb3b50000)
libxcb-dri2.so.0 => /usr/lib/i386-linux-gnu/libxcb-dri2.so.0 (0xb3b4a000)
libxcb-dri3.so.0 => /usr/lib/i386-linux-gnu/libxcb-dri3.so.0 (0xb3b46000)
libxcb-present.so.0 => /usr/lib/i386-linux-gnu/libxcb-present.so.0 (0xb3b42000)
libxcb-sync.so.1 => /usr/lib/i386-linux-gnu/libxcb-sync.so.1 (0xb3b3a000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xb3b18000)
libxshmfence.so.1 => /usr/lib/i386-linux-gnu/libxshmfence.so.1 (0xb3b15000)
libXxf86vm.so.1 => /usr/lib/i386-linux-gnu/libXxf86vm.so.1 (0xb3b0f000)
libdrm.so.2 => /usr/lib/i386-linux-gnu/libdrm.so.2 (0xb3b00000)
libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0xb3af8000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xb3af4000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xb3aed000)
You have the 64bit libpulse0, while the program you're trying to run is 32bit.
On 64bit Ubuntu you can install 32bit libraries by adding :i386 to the package name:
apt-get install libpulse0:i386
I tried all methods found, finally I fixed it by installing a package called pulseaudio:
sudo apt-get install pulseaudio

Why nam.exe doesn't work in the cygwin without startX?

I'm trying to use NS2 but when I try to use nam.exe it'd not work! So is there other way to use nam.exe whitout using startX in CygWin?
thank you
Regards
``nam´´ is a GUI application (for X), and as such it requires X.
``nam´´ is using some X libraries:
$ ldd /usr/local/bin/nam
libXext.so.6 => /usr/lib/libXext.so.6 (0xb76b2000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb7564000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7548000)
libdl.so.2 => /lib/libdl.so.2 (0xb7543000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb744f000)
libm.so.6 => /lib/i686/libm.so.6 (0xb7402000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb73e4000)
libc.so.6 => /lib/i686/libc.so.6 (0xb721a000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb71f7000)
/lib/ld-linux.so.2 (0xb76ec000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb71f3000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb71ec000)

ldd shows varied addresses on x86 Linux

I am using ldd to show the dynamic library on Fedora/x86, and it shows different results each time it is used.
Is that expected? Or is there an explanation?
I remember it shows a fixed result on PPC/Linux.
`ldd /bin/ls
linux-gate.so.1 => (0x00e5b000)
librt.so.1 => /lib/librt.so.1 (0x00c0c000)
libselinux.so.1 => /lib/libselinux.so.1 (0x0095d000)
libcap.so.2 => /lib/libcap.so.2 (0x00110000)
libacl.so.1 => /lib/libacl.so.1 (0x00331000)
libc.so.6 => /lib/libc.so.6 (0x00115000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00bc9000)
/lib/ld-linux.so.2 (0x009d2000)
libdl.so.2 => /lib/libdl.so.2 (0x00680000)
libattr.so.1 => /lib/libattr.so.1 (0x00447000)
ldd /bin/ls
linux-gate.so.1 => (0x00f76000)
librt.so.1 => /lib/librt.so.1 (0x00494000)
libselinux.so.1 => /lib/libselinux.so.1 (0x0095d000)
libcap.so.2 => /lib/libcap.so.2 (0x009e9000)
libacl.so.1 => /lib/libacl.so.1 (0x00365000)
libc.so.6 => /lib/libc.so.6 (0x00732000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00b61000)
/lib/ld-linux.so.2 (0x002a7000)
libdl.so.2 => /lib/libdl.so.2 (0x002f0000)
libattr.so.1 => /lib/libattr.so.1 (0x00447000)`
Fedora uses address space randomization as part of its various security measures. ldd works by actually loading the shared objects and showing where they end up. Putting the two together results in the given observations.

Resources