I have installed the boost library with homebrew and if I write:
include_directories(/opt/homebrew/Cellar)
link_directories(/opt/homebrew/Cellar/boost/1.76.0/)
add_executable(Project main.cpp)
target_link_libraries(Project boost)
And then include it in my script:
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
It doesn't find it, when I write:
#include <boost/1.76.0/include/boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
It does find it but I get following error:
/opt/homebrew/Cellar/boost/1.76.0/include/boost/multiprecision/cpp_int.hpp:12:10: fatal error: 'boost/multiprecision/number.hpp' file not found
#include <boost/multiprecision/number.hpp>
The number.hpp file can't include the boost library.
Can anyone make sense out of this and can help me?
To add a Boost header-only library, such as multiprecision
with cmake, usually all you need to do is:
find_package(Boost)
link_libraries(Boost::headers)
In case Boost was not installed correctly, you might still add it with:
include_directories(/opt/homebrew/include)
or:
include_directories(/opt/homebrew/Celler/boost/1.76.0/include)