找不到-lpthread

标签 c pthreads compilation cross-compiling samba

我正在尝试交叉编译 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

有人知道解决方案吗?

最佳答案

与 mingw 有同样的问题。从 ftp://sourceware.org/pub/pthreads-win32/dll-latest/lib/x86/ 得到 libpthreadGC2.a ,放到C;\mingw\lib中,改名为libpthread.a。我不知道 gcc 的 -l 开关意味着“将‘lib’附加到前面,将‘.a’附加到后面”,例如-lpthread = libpthread.a

关于找不到-lpthread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6842010/

相关文章:

c++ - 诠释 [0];这个语句有什么用?它在哪里有意义?

c - 如何使用包含线程的个人库编译 C 程序

使用非阻塞键盘输入退出创建无限循环

c++ - 如何将 C++ 程序编译为 32 位可执行文件而不是 64 位

compilation - 在 Mac OS 10.9 上编译 VLCKit

c - 如何在不公开其类型的情况下公开 C 结构大小?

c - 使用用户输入和 80 的缓冲区操作 C 中的字符串

linux - LOAD 段的对齐不是 2MB 的倍数

c - 在 iOS 设备上编写和访问应用程序文件

linux - NPTL 默认堆栈大小问题