CMake警告:未定义Boost标头

时间:2017-08-31 12:55:00

标签: boost cmake header warnings

我在Windows x64机器上安装了Boost 1.64.0。 使用下面的CmakeLists.txt代码

set("BOOST_ROOT" "C:/local/boost_1_64_0/")
set("BOOST_INCLUDEDIR" "C:/local/boost_1_64_0/boost/")
set("BOOST_LIBRARYDIR" "C:/local/boost_1_64_0/lib64-msvc-14.1")

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)

#find_package(Boost REQUIRED COMPONENTS system filesystem program)
find_package(Boost REQUIRED COMPONENTS
system-vc141-mt-gd-1_64.lib
filesystem-vc141-mt-gd-1_64.lib
program_options-vc141-mt-gd-1_64.lib)

include_directories(${Boost_INCLUDE_DIRS})

我收到三个警告,每个库找到一个警告:

CMake Warning at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1566 (message):
No header defined for system-vc141-mt-gd-1_64.lib; skipping header check
Call Stack (most recent call first): CMakeLists.txt:44 (find_package)


CMake Warning at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1566 (message):
No header defined for filesystem-vc141-mt-gd-1_64.lib; skipping header check
Call Stack (most recent call first): CMakeLists.txt:44 (find_package)


CMake Warning at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1566 (message):
No header defined for program_options-vc141-mt-gd-1_64.lib; skipping header
check Call Stack (most recent call first): CMakeLists.txt:44 (find_package)

如何让cmake找到提升标题?

1 个答案:

答案 0 :(得分:0)

回答我关于问题根源的问题。 很可能Boost安装在机器上没有正确完成,并且未按预期生成库的路径。我将再次检查这一点并再次重做我的Boost安装。