在Visual Studio 2008连接器连接问题提振 [英] Linker problem linking boost in Visual Studio 2008
问题描述
我在Visual Studio 2008中一个默默无闻的连接问题的链接器错误消息是:LNK1104:无法打开文件'boost_thread-vc90-MT-GD-1_38.lib'。所有pathes和依赖设置。
我注意到,虽然是Visual Studio中错过boost_thread-vc90-MT-GD-1_38.lib而不是 libboost_thread-vc90-MT-GD-1_38.lib (注意在文件开头的lib名称)。我加入的.lib为libboost_thread-vc90-MT-GD-1_38.lib到项目,并将其显示为libboost_thread-vc90-MT-GD-1_38.lib在命令行。
I have a rather obscure linking problem in Visual Studio 2008. The linker error message is: "LNK1104: cannot open file 'boost_thread-vc90-mt-gd-1_38.lib'". All pathes and dependencies are set. What I noticed though is that Visual Studio misses boost_thread-vc90-mt-gd-1_38.lib and not libboost_thread-vc90-mt-gd-1_38.lib (notice the lib at the beginning of the file name). I added the .lib as libboost_thread-vc90-mt-gd-1_38.lib to the project and it appears as libboost_thread-vc90-mt-gd-1_38.lib in the command line.
为什么Visual Studio中的文件名的开始?
Why does Visual Studio the beginning of the file name?
推荐答案
有是用于升压命名程序库的规则:
There is a rule for naming libraries in Boost:
1)boost_thread-vc90-MT-GD-1_38.lib动态链接版本
2)libboost_thread-vc90-MT-GD-1_38.lib对于静态链接的版本。
1) boost_thread-vc90-mt-gd-1_38.lib for dynamically linked version 2) libboost_thread-vc90-mt-gd-1_38.lib for statically linked version
BOOST_LIB_ preFIX:LIB对于静态库,否则
有一个preprocessor定义,你可以在你的项目才能使用升压库的动态链接版本定义 BOOST_DYN_LINK = 1
There is a preprocessor define that you can define in your project in order to use the dynamically linked version of a boost library BOOST_DYN_LINK=1
它有这样的描述:
BOOST_DYN_LINK:可选:要设置链接dll而不是静态库
另外一个定义,告诉使用Boost.Thread动态版 BOOST_THREAD_USE_DLL
Another define that tells to use the dynamic version of Boost.Thread is BOOST_THREAD_USE_DLL
这篇关于在Visual Studio 2008连接器连接问题提振的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!