问题
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
& tried it in my MSVC 9.0 but I am getting this error
1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-gd-1_36.lib'
how to solve this problem please help me.
回答1:
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.
I am using MSVC 10.0, but I think it is the same.
回答2:
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.
I recommend you to c:\ directory.
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.
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.
And you are good to go
回答3:
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:
"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:
"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.
来源:https://stackoverflow.com/questions/4789912/1link-fatal-error-lnk1104-cannot-open-file-libboost-system-vc90-mt-gd-1-36