C++ 使用eclipse的Boost找不到线程库
我已经下载并构建了boost库C++ 使用eclipse的Boost找不到线程库,c++,eclipse,boost,C++,Eclipse,Boost,我已经下载并构建了boost库 bootstrap mingw 及 这些库是在中创建的 C:\Boost\boost_1_57_0\stage\lib 在eclipse中,我添加了这个目录作为库路径 并添加了库libboost_-thread-mgw49-mt-1_57,在末尾添加和不添加.a g++行看起来像 g++ "-LC:\\Boost\\boost_1_57_0\\stage\\lib" -o MyThread.exe main.o MyThread.o -llibboost_t
bootstrap mingw
及
这些库是在中创建的
C:\Boost\boost_1_57_0\stage\lib
在eclipse中,我添加了这个目录作为库路径
并添加了库libboost_-thread-mgw49-mt-1_57
,在末尾添加和不添加.a
g++行看起来像
g++ "-LC:\\Boost\\boost_1_57_0\\stage\\lib" -o MyThread.exe main.o MyThread.o -llibboost_thread-mgw49-mt-1_57
我得到了错误信息
ld.exe: cannot find -llibboost_thread-mgw49-mt-1_57 collect2.exe: error: ld returned 1 exit status
如果我添加.a
,它将按预期附加到错误消息中
我做错了什么?指定没有
lib
前缀的库(这是UNIX惯例):
甚至有可能(借助于一些标准的约定符号链接)您可以说-lboost\u thread
PS别忘了也使用
-pthread谢谢你,删除lib确实有效,我感谢你的帮助。
ld.exe: cannot find -llibboost_thread-mgw49-mt-1_57 collect2.exe: error: ld returned 1 exit status
g++ "-LC:\Boost\boost_1_57_0\stage\lib" -pthread -o MyThread.exe main.o MyThread.o -libboost_thread-mgw49-mt-1_57