找不到-lpthread

时间:2011-07-27 09:21:14

标签: 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

任何人都知道解决方案吗?

2 个答案:

答案 0 :(得分:2)

有同样的问题w / mingw。从ftp://sourceware.org/pub/pthreads-win32/dll-latest/lib/x86/获得libpthreadGC2.a,将其放在C; \ mingw \ lib中并将其重命名为libpthread.a。我不知道gcc的-l开关意味着" apprend' lib'在前面和' .a'到后面"例如-lpthread = libpthread.a

答案 1 :(得分:-1)

确保pthread库位于链接器的库搜索路径中。

相关问题