CMake with Boost library Windows 10 Library not found correctly

前端 未结 2 1257
情书的邮戳
情书的邮戳 2021-01-03 12:41

Like many others i have problems using boost libraries with windows. On Ubuntu 16.04 it works all very well with libboost-all-dev but on windows i have many problems.

<
相关标签:
2条回答
  • 2021-01-03 13:02

    Ok finally i've found a solution after reading many, many and many more pages on the internet.

    The solution is really simple. After downloading the boost package and installing it (or building from source) you just need the following two parts:

    • Open your CMD (cmd.exe)
    • switch to your installation directory of boost (example C:\local\boost_1_58_0)

    Just run the following commands:

    bootstrap.bat
    b2 link=static runtime-link=static release stage
    

    This will create all librarys static and makes it useable for cmake.

    This solution works for me and made me able to build the needed package.

    Thanks for all helpers

    0 讨论(0)
  • 2021-01-03 13:07

    Or you could just tell boost which compiler to use by adding

    toolset=msvc-12.0

    (for MS 2013 v12, etc.)

    to the b2 command line :-)

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