【发布时间】:2013-06-26 01:16:33
【问题描述】:
我已经搜索过这个答案。我已经尝试过对 Stack 和其他网站上发布的类似问题的建议。我的工具链由 x64 机器组成,带有 windows 7、visual studio 2010、opencv 2.4、qt 4.8 和 boost。我使用 CMake 配置我的所有项目,它会找到所有这些库并包含并创建我的 Visual Studio 项目。我已经编译了两个版本的 boost,一个 32 位版本在命令行中构建并放在 \boost\boost_1_47_0\lib\win32 中,一个 64 位版本在 Windows SDK v7.1 64 位编译器中编译并存储在\升压\升压_1_47_0\lib\x64。除了 boost 之外,项目中的所有内容都可以正常编译。我得到一个编译器错误:
fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-1_47.lib'
提醒一下,CMake 正在处理我的所有链接,它会正确定位此库并将其添加到 Visual Studio 项目中。我可以通过查看属性->链接器->命令行来验证这一点。在这里,除了代表其他库的文件外,还列出了:
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_filesystem-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_program_options-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_date_time-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_thread-vc100-mt-1_47.lib"
我可以通过手动将我的 boost\boost_1_47_0\lib\x64 目录添加到 Properties->Linker->General->Additional Library Dependencies 来抑制这个错误。这编译没有错误。然而,当我去运行应用程序时,我遇到了一个系统错误,告诉我:
The program can't start because boost_filesystem-vc100-mt-1_47.dll is missing from your computer. Try reinstalling the program to fix this problem.
在这个 /x64 目录中,我有:
boost_filesystem-vc100-mt-1_47.dll
boost_filesystem-vc100-mt-1_47.lib
libboost_filesystem-vc-100-mt-1_47.dll
任何见解都将不胜感激。谢谢!
【问题讨论】:
-
与此问题相似或等效:stackoverflow.com/q/6468681/417197?
-
是的,这似乎与另一个问题中关于自动动态链接的问题相同。
标签: visual-studio-2010 qt opencv boost cmake