开发者

pthread Library location

In which directory does the libpthread l开发者_开发技巧ibrary reside on a Linux system ?


There are a number of ways to find this out.

Simply type find / -name 'libpthread.so' -print to find the file named libpthread.so on your system.

You can check the library locations your dynamic linker ld checks in for libraries, which are listed in /etc/ld.so.conf.

Also, if you are running a debian-based distro, or have dpkg installed, you can use dpkg -S libpthread, which will give you the packages that contain files with the name libpthread and where those files are installed. Distros with RPM support should have a similar feature. Hope this helps!


You can try the following command = locate libpthread.so

it gave the following output when I tried :

/lib/i386-linux-gnu/libpthread.so.0
/usr/lib/i386-linux-gnu/libpthread.so


In Ubuntu 16.04.2 and Oracle Linux OS 6.8, you can run the following command:

ldconfig -p | grep pthread.so

Sample output:

libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.32) => /lib/x86_64-linux-gnu/libpthread.so.0
libgpgme-pthread.so.11 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgpgme-pthread.so.11


The pthreads run time library usually lives in /lib, while the development library usually lives in /usr/lib. This can vary by distribution, but this is at least the location on Debian and Ubuntu and I doubt other mainstream distributions use anything else.


In Ubuntu it is located in usr/lib/i386-linux-gnu/. At least, it is the path on my system!


Another simple way:

ldd /bin/tar | grep pthread
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f803cdd4000)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜