本文介绍了crosstools-ng找不到pthread.so的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用crosstools-ng来编译使用pthread的程序,但由于某些原因链接程序找不到该库。我已经检查过,并且这些库位于由 -L
指定的链接路径中是参数。
以下是错误:
/ home / *** /raspberrypi/toolchain/lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../ arm-unknown-linux-gnueabi / bin / ld:找不到/ lib / arm-linux-gnueabihf / libpthread.so.0
/home/***/raspberrypi/toolchain/lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../。 ./../../arm-unknown-linux-gnueabi/bin/ld:找不到/usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a
为什么ld不能找到路径内的文件?
解决方案
/ * GNU ld脚本
使用共享库,但某些函数仅在
静态库中,所以请尝试其次。 * /
OUTPUT_FORMAT(elf32-littlearm)
GROUP(/lib/arm-linux-gnueabihf/libpthread.so.0 /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a)
至
/ * GNU ld脚本
使用共享库,但某些函数仅在
静态库中,因此请尝试其次。 * /
OUTPUT_FORMAT(elf32-littlearm)
GROUP(libpthread.so.0 libpthread_nonshared.a)
I am trying to use crosstools-ng to compile a program that uses pthread, however for some reason the linker can't find the library. I have checked and the libraries are located in the link path specificed by -L
is the arguments.
Here is the error:
/home/***/raspberrypi/toolchain/lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../.. /arm-unknown-linux-gnueabi/bin/ld: cannot find /lib/arm-linux-gnueabihf/libpthread.so.0
/home/***/raspberrypi/toolchain/lib/gcc/arm-unknown-linux-gnueabi/4.6.3/../../../../arm-unknown-linux-gnueabi/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a
Why can't ld find the file that is within the path?
解决方案
Edit your .../usr/lib/arm-linux-gnueabihf/libpthread.so:
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/arm-linux-gnueabihf/libpthread.so.0 /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a )
to
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( libpthread.so.0 libpthread_nonshared.a )
这篇关于crosstools-ng找不到pthread.so的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!