无法打开文件 libboost_thread_vc-100-mt-gd-1_48.lib
cannot open file libboost_thread_vc-100-mt-gd-1_48.lib
在Qt Creator中编译我的程序时,我收到链接器错误
:-1: error: LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_48.lib'
我在 .pro 文件中添加了以下行
win32: LIBS += -L$$PWD/../../../../../../../boost_1_48_0/stage/lib/ -lboost_thread-vc100-mt-gd-1_48
INCLUDEPATH += $$PWD/../../../../../../../boost_1_48_0/stage
DEPENDPATH += $$PWD/../../../../../../../boost_1_48_0/stage
我仍然遇到相同的错误,所以我重建了库
C:boost_1_48_0>bjam.exe --toolset=msvc --build-type=complete link=shared runtime-link=shared --with-thread --clean
C:boost_1_48_0>bjam.exe --toolset=msvc --build-type=complete link=shared runtime-link=shared --with-thread
使用静态库时
win32: LIBS += -L$$PWD/../../../../../../../boost_1_48_0/stage/lib/ -llibboost_thread-vc100-mt-sgd-1_48
INCLUDEPATH += $$PWD/../../../../../../../boost_1_48_0/stage
DEPENDPATH += $$PWD/../../../../../../../boost_1_48_0/stage
win32: PRE_TARGETDEPS += $$PWD/../../../../../../../boost_1_48_0/stage/lib/libboost_thread-vc100-mt-sgd-1_48.lib
我收到更多错误
msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) already defined in libboost_thread-vc100-mt-sgd-1_48.lib(thread.obj)
msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in libboost_thread-vc100-mt-sgd-1_48.lib(thread.obj)
msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@QAE@XZ) already defined in libboost_thread-vc100-mt-sgd-1_48.lib(thread.obj)
msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: static unsigned int __cdecl std::numeric_limits<unsigned int>::max(void)" (?max@?$numeric_limits@I@std@@SAIXZ) already defined in libboost_thread-vc100-mt-sgd-1_48.lib(thread.obj)
msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: static __int64 __cdecl std::numeric_limits<__int64>::max(void)" (?max@?$numeric_limits@_J@std@@SA_JXZ) already defined in libboost_thread-vc100-mt-sgd-1_48.lib(thread.obj)
LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_48.lib'
link /LIBPATH:"c:Qt4.8.1lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debugPlayer.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debugPlayer.exe @C:UsersvickeyAppDataLocalTempPlayer.exe.948.15.jom
c:qt4.8.1binqmake.exe -spec c:Qt4.8.1mkspecswin32-msvc2010 CONFIG+=declarative_debug -o Makefile c:cygwinhomevickeytunebasketp2ptestPlayerPlayer.pro
C:QtSDKQtCreatorbinjom.exe -f Makefile.Debug
任何想法有什么问题?谢谢。
#define BOOST_ALL_NO_LIB
为我工作。我猜的问题是链接器正在寻找libboost_thread_vc-100-mt-gd-1_48.lib,而我在.pro文件中配置了boost_thread_vc-100-mt-gd-1_48.lib。定义宏会使其显式上载 .pro 文件中定义的库。
相关文章:
- C++问题:用户认为数字1-100,程序提出问题不超过6次即可得到答案。无法正确
- 参考资源文件VC++中的$(SolutionDir)
- VC++本机单元测试,找不到调试符号
- 在std::thread中,joinable()然后join()线程安全吗
- <Windows>为什么 std::thread::native_handle 返回类型为"long long unsigned int"的值,而不是 void*(又名 HANDLE)?
- 分离一个静态常量 std::thread?
- 有哪些有效的方法可以消除一组 100 万个字符串>重复数据?
- 尝试使用 std::vector<std::thread时出现静态断言失败错误>
- 使用 thread 类在 C++ 中构造线程的动态数组时出错
- 当指向对象的指针作为参数传递给 std::thread 时,内存可见性
- 如何从 std::thread 返回值
- 在C++中使用并行化的预期速度是多少(不是 OpenMp,而是 <thread>)
- 介于 1 和 100 之间的质数列表
- 将 std::thread by 值推送到列表中
- 转发变量参数列表以模拟 std::thread
- 嵌入式设备 -> std::thread -> FreeRTOS?
- 对 'std::thread::_M_start_thread CMake 的未定义引用进行基准测试
- 在这里,当我们比较 if(vc[i]==vc1[i]) 时,它是向量数组. 实际上比较的值是多少,
- VS2015 中的 VC++ 目录
- std::thread 增加 DLL 引用计数,从而防止卸载 DLL