【发布时间】:2020-11-23 09:39:07
【问题描述】:
我正在尝试使用 boost 库创建一个简单的示例。我可以成功地使用 CMake 进行初始设置,并且它找到了提升。
在 CMakeLists.txt 中使用以下代码:
cmake_minimum_required(VERSION 3.18)
project(edge_detector)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(edge_detector main.cpp)
target_include_directories(edge_detector PUBLIC ${Boost_INCLUDE_DIRS})
target_link_libraries(edge_detector ${Boost_LIBRARIES})
但是,当我尝试使用 make 或 CMake --build 构建项目时。未找到 boost,我遇到了这个错误:
我不确定我错过了什么,我将不胜感激任何帮助
【问题讨论】:
-
欢迎您read this