Craques
Craques

Reputation: 1143

Installing boost on macos

I am trying to create a simple example using the boost library. I can successfully use CMake for the initial setup and it finds boost.

enter image description here

using the following code in 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})

However when I try to build the project using make or CMake --build . boost is not found and I am met with this error:

enter image description here

I am not sure what I am missing, I would be grateful for any help

Upvotes: 0

Views: 138

Answers (1)

vre
vre

Reputation: 6744

Your include directive must include a file not a directory. Replace

#include <boost/algorithm/string>

with

#include <boost/algorithm/string.hpp>

Upvotes: 3

Related Questions