Failed linking to boost library with CMake generated project file for MSVC9

前端 未结 2 449
离开以前
离开以前 2020-12-06 02:15

I\'m trying to build an application with boost library by creating a MSVC9.0 project files with CMake.

I get the following error:

Error 3 f

2条回答
  •  失恋的感觉
    2020-12-06 02:36

    First of all, did you check if "'libboost_system-vc90-mt-gd-1_44.lib" really exists in your stage-dir "D:/boost_1_44_0/stage/lib"?

    Second: the most common problem I used to have with Boost and CMake's find_package( Boost) was interference with the auto-linking. You could disable it by adding a definition to your compile flags

    add_definitions( -DBOOST_ALL_NO_LIB )
    

    but then you probably will need to specify if you want to link to the dynamic or static version

    set( Boost_USE_STATIC_LIBS ON ) # or Off, depending on what you want
    find_package( Boost 1.44.0 REQUIRED unit_test_framework system)
    

    Of course, you could always check the generated visual studio files to see which link-libraries are actually added to your project.

提交回复
热议问题