C++ 1>LINK : 致命错误 LNK1104: 无法打开文件“libboost_system-vc90-mt-gd-1_36.lib”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4789912/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_36.lib'
提问by amrit_neo
I have created a application for using the libtorrent. In that I am using the boost library. I tried the sample example given in http://www.rasterbar.com/products/libtorrent/examples.html
我已经创建了一个使用 libtorrent 的应用程序。因为我正在使用 boost 库。我尝试了http://www.rasterbar.com/products/libtorrent/examples.html 中给出的示例示例
& tried it in my MSVC 9.0 but I am getting this error
并在我的 MSVC 9.0 中尝试过,但出现此错误
1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_36.lib'
1>LINK : 致命错误 LNK1104: 无法打开文件“libboost_system-vc90-mt-gd-1_36.lib”
how to solve this problem please help me.
如何解决这个问题,请帮助我。
回答by Rui Teng
Right click the project, and choose "Properties" --> "Linker" --> "General" --> "Additional Library Directories", add your path of libboost_system-vc90-mt-gd-1_36.lib in it. "Properties" --> "Linker" --> "Input" --> "Additional Dependencies", add libboost_system-vc90-mt-gd-1_36.lib in it.
右键单击该项目,然后选择“属性”-->“链接器”-->“常规”-->“附加库目录”,在其中添加您的 libboost_system-vc90-mt-gd-1_36.lib 路径。“属性”-->“链接器”-->“输入”-->“附加依赖”,在其中添加libboost_system-vc90-mt-gd-1_36.lib。
I am using MSVC 10.0, but I think it is the same.
我使用的是 MSVC 10.0,但我认为它是一样的。
回答by Wu Jie
The simplest way for an amateur like me that is studying c++ on their own. firstly Unzip the boost library to any directory of your choice.
对于像我这样自学 C++ 的业余爱好者来说,这是最简单的方法。首先将 boost 库解压缩到您选择的任何目录。
I recommend you to c:\ directory.
我推荐你到c:\目录。
1:open your visual c++.
2:create a new project.
3:right click on the project solution.
4:click on property.
5:click on c/c++.
6:click on general.
7:select additional include library.
8:include the library destination. eg c:\boost_1_57_0.
9:click on pre-compiler header.
10:click on create/use precompiled header.
11:select not using precompiled header.
1:打开你的visual c++。
2:新建项目。
3:右键单击项目解决方案。
4:点击属性。
5:点击c/c++。
6:点击通用。
7:选择附加的包含库。
8:包括库目的地。例如 c:\boost_1_57_0。
9:点击预编译头。
10:点击创建/使用预编译头。
11:选择不使用预编译头。
Then the work now go over to the link library were you experience your problem as an armature.
然后,现在工作转到链接库,如果您遇到了作为骨架的问题。
Firstly,
首先,
1:go to were the extracted file was c:\boost_1_57_0.
2:click on booststrap.bat (don't bother to type on the command window just wait and don't close the window that is the place I had my problem that took me two weeks to solve. after a while the booststrap will run and produce the same file, but now in two different name b2, and bjamp.
3:click on b2 and wait it to run.
4:click on bjam and wait it to run.
then a folder will be produce call stage.
then go back to stage 4.
5:click on linker.
6:click on general.
7:click on include additional library directory.
8: select the part of the library eg. c:\boost_1_57_0\stage\lib.
1:转到提取的文件是c:\boost_1_57_0。
2:单击booststrap.bat(不要费心在命令窗口中输入,只需等待,不要关闭我遇到问题的地方,我花了两周时间才解决的窗口。一段时间后,booststrap将运行并产生相同的文件,但现在有两个不同的名称 b2 和 bjamp。
3:单击 b2 并等待它运行。
4:单击 bjam 并等待它运行。
然后将产生一个文件夹,然后生成调用阶段。
然后去回到阶段4。5
:点击链接器
。6:点击常规
。7:点击包括附加库目录
。8:选择库的一部分,例如c:\boost_1_57_0\stage\lib。
And you are good to go
你很高兴去
回答by user2317617
This solution fixed the linking error issue in MVS 2008 V9 VC++. My error was similar, although the message was slightly different because I have version 1.53.0. Here is my error message:
此解决方案修复了 MVS 2008 V9 VC++ 中的链接错误问题。我的错误是相似的,尽管消息略有不同,因为我有 1.53.0 版。这是我的错误信息:
"fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1_53.lib'".
"fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1_53.lib'".
You have to enter the entire path of the directory to the missing lib file. This is the path I had to add to "Properties" --> "Linker" --> "Input" --> "Additional Dependencies". Full path:
您必须输入缺少的 lib 文件的整个目录路径。这是我必须添加到“属性”-->“链接器”-->“输入”-->“附加依赖项”的路径。完整路径:
"C:\Program Files\boost\boost_1_53_0\bin.v2\libs\regex\build\msvc-9.0\debug\link-static\threading-multi".
NOTE: This fixed the problem which as a linking error in the compilation of the Boost.Regex c++ build example.
"C:\Program Files\boost\boost_1_53_0\bin.v2\libs\regex\build\msvc-9.0\debug\link-static\threading-multi".
注意:这修复了在 Boost.Regex c++ 构建示例的编译中作为链接错误的问题。