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