crosstools-ng找不到pthread.so

Joh*_*ohn 7 gcc cross-compiling

我正在尝试使用crosstools-ng来编译使用pthread的程序,但是由于某种原因,链接器无法找到该库.我检查过,并且库位于由-L参数指定的链接路径中.

这是错误:

/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
Run Code Online (Sandbox Code Playgroud)

为什么不能找到路径中的文件?

小智 6

编辑你的.../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 )
Run Code Online (Sandbox Code Playgroud)

/* 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 )
Run Code Online (Sandbox Code Playgroud)