fatal error LNK1104: cannot open file 'libboost_system-vc110-mt-gd-1_51.lib'

前端 未结 10 1459
时光取名叫无心
时光取名叫无心 2020-11-28 20:31

Seem I can\'t get this to work. I made a simple console application (which depend on websocket++ library) which need Boost libraries.. but when I t

相关标签:
10条回答
  • 2020-11-28 20:45

    b2 -j%cores% toolset=%msvcver% address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64

    Properties → Linker → General → Additional Library Directories $(BOOST)\stage\x64\lib

    0 讨论(0)
  • 2020-11-28 20:46

    The C++ → General → Additional Include Directories parameter is for listing directories where the compiler will search for header files.

    You need to tell the linker where to look for libraries to link to. To access this setting, right-click on the project name in the Solution Explorer window, then Properties → Linker → General → Additional Library Directories. Enter <boost_path>\stage\lib here (this is the path where the libraries are located if you build Boost using default options).

    0 讨论(0)
  • 2020-11-28 20:47

    I had the same problem. It was caused because I compiled the Boost with the Visual C++ 2010(v100) and I tried to use the library with the Visual Studio 2012 (v110) by mistake.

    So, I changed the configurations (in Visual Studio 2012) going to Project properties -> General -> Plataform Toolset and change the value from Visual Studio 2012 (v110) to Visual Studio 2010 (v100).

    0 讨论(0)
  • 2020-11-28 20:53

    This is the simplest way for an amateur like me who is studying C++ on their own:

    First Unzip the boost library to any directory of your choice. I recommend c:\directory.

    1. Open your visual C++.
    2. Create a new project.
    3. Right click on the project.
    4. Click on property.
    5. Click on C/C++.
    6. Click on general.
    7. Select additional include library.
    8. Include the library destination. e.g. c:\boost_1_57_0.
    9. Click on pre-compiler header.
    10. Click on create/use pre-compiled header.
    11. Select not using pre-compiled header.

    Then go over to the link library were you experienced your problems.

    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 with two different names: b2, and bjam.
    3. Click on b2 and wait it to run.
    4. Click on bjam and wait it to run. Then a folder will be produce called stage.
    5. Right click on the project.
    6. Click on property.
    7. Click on linker.
    8. Click on general.
    9. Click on include additional library directory.
    10. Select the part of the library e.g. c:\boost_1_57_0\stage\lib.

    And you are good to go!

    0 讨论(0)
  • 2020-11-28 20:56

    2>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc120-mt-sgd-1_55.lib

    In my case, bootstrap/bjam was not available (libraries were precompiled and committed to SCM) on old inherited project. Libraries did not have VC or BOOST versioning in their filenames eg: libboost_regex-mt-sgd.lib, however Processed /DEFAULTLIB:libboost_regex-vc120-mt-sgd-1_55.lib was somehow triggered automatically.

    Fixed by manually adding the non-versioned filename to:

    <AdditionalDependencies>$(DK_BOOST)\lib64\libboost_regex-mt-sgd.lib</AdditionalDependencies>
    

    and blacklisting the ...vc120-mt-sgd-1_55.lib in

    <IgnoreSpecificDefaultLibraries>libboost_regex-vc120-mt-sgd-1_55.lib</IgnoreSpecificDefaultLibraries>
    
    0 讨论(0)
  • 2020-11-28 20:57

    I had the same problem and my mistake was that I had installed the binary boost_1_55_0-msvc-11.0-32.exe to use with visual c++ 2010 which has the version v100 (project properties->ConfiguratioProperties->General->platformTooset) not v110 as visual c++ 2012. So I dowloaded boost_1_55_0-msvc-10.0-32.exe and now everything is ok so far.

    0 讨论(0)
提交回复
热议问题