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

前端 未结 10 1526
时光取名叫无心
时光取名叫无心 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:58

    I had same issue reported here. I solved the issue moving the mainTest.cpp from a subfolder src/mainTest/ to the main folder src/ I guess this was your problem too.

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

    In case you have trouble building boost or prefer not to do that, an alternative is to download the lib files from SourceForge. The link will take you to a folder of zipped lib and dll files for version 1.51. But, you should be able to edit the link to specify the version of choice. Apparently the installer from BoostPro has some issues.

    0 讨论(0)
  • 2020-11-28 21:07

    I had a similar problem when trying to use boost unit testing in Visual Studio 2015 (Community Edition):

    fatal error LNK1104: libboost_unit_test_framework-vc140-mt-1_57

    so I thought I'd share my solution.

    You can create a boost unit testing project in of of two ways (and this solution works for both):

    1. using the Boost Unit Test Adapter
    2. or by creating a Win32 Console Application (steps here), and substituting the main function with a boost unit testing function (steps here).

    Here are the steps I followed to get both projects to work:

    First, download the desired boost version (for example, boost_1_57_0). You can either download boost with the correct binaries (compiled using msvc v140), or extract the binaries yourself by running the following commands from command line:

    1. bootstrap.bat
    2. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
    3. bjam --clean
    4. bjam -j4 --debug-symbols=on --build-type=complete toolset=msvc-14.0 threading=multi runtime-link=shared address-model=32

    Where msvc-14.0 specifies that we require the Visual Studio 2015 version (VS 2015 = v14.0 = v140), and address-model=32 specifies that we require platform 32 (but the same can be done for 64 bit).

    Once you have the binaries, go to Visual Studio, select the Boost Unit Testing project you have created. Go to Project properties > configuration (from the main menu) and make the following choices:

    • Set the "General > Platform Toolset" to Visual Studio 2015 (v140).

    • Include the path to the boost folder (e.g. C:\boost_1_57_0) and the path to the subfolder containing the binary files (e.g. C:\boost_1_57_0\stage\lib) in:

      • "C\C++ > Additional Include Directory"
      • and "Linker > Additional Library Directories".
    0 讨论(0)
  • 2020-11-28 21:09

    Yet another solution:

    I was stumped because I was including boost_regex-vc120-mt-gd-1_58.lib in my Link->Additional Dependencies property, but the link kept telling me it couldn't open libboost_regex-vc120-mt-gd-1_58.lib (note the lib prefix). I didn't specify libboost_regex-vc120-mt-gd-1_58.lib.

    I was trying to use (and had built) the boost dynamic libraries (.dlls) but did not have the BOOST_ALL_DYN_LINK macro defined. Apparently there are hints in the compile to include a library, and without BOOST_ALL_DYN_LINK it looks for the static library (with the lib prefix), not the dynamic library (without a lib prefix).

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