找不到-lpthread
我正在尝试交叉编译 samba 服务器。
./config 工作得很好,但是当我想用 make 构建时,提示说:
Linking shared library bin/libsmbclient.so.0
/opt/qnx630/host/linux/x86/usr/bin/ntoarm-ld: cannot find -lpthread
collect2: ld returned 1 exit status
make: *** [bin/libsmbclient.so.0] Error 1
有人知道解决方案吗?
I am trying to cross compile samba server.
./config works just fine, but when I want to build with make the prompt says:
Linking shared library bin/libsmbclient.so.0
/opt/qnx630/host/linux/x86/usr/bin/ntoarm-ld: cannot find -lpthread
collect2: ld returned 1 exit status
make: *** [bin/libsmbclient.so.0] Error 1
Anyone knows a solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
w/mingw 也有同样的问题。从 ftp://sourceware.org/pub/pthreads 获取 libpthreadGC2.a -win32/dll-latest/lib/x86/,放入C;\mingw\lib并重命名为libpthread.a。我不知道 gcc 的 -l 开关意味着“将 'lib' 添加到前面,将 '.a' 添加到后面”,例如 -lpthread = libpthread.a
had this same problem w/mingw. got libpthreadGC2.a from ftp://sourceware.org/pub/pthreads-win32/dll-latest/lib/x86/, put it in C;\mingw\lib and renamed it to libpthread.a. i didn't know gcc's -l switch means "apprend 'lib' to the front and '.a' to the back" e.g. -lpthread = libpthread.a
确保 pthread 库位于链接器的库搜索路径中。
Make sure that the
pthread
library is in the library search path of the linker.