I’m trying to use the mongocxx driver, which I installed from homebrew, with my cmake project, but when I build it, this error shows up:
fatal error: ‘bsoncxx/json.hpp’ file not found
So I tried to add this line to my CMakeLists:
include_directories(“/opt/homebrew/include/bsoncxx/v_noabi”)
and it hit me with another error:
fatal error: ‘core/optional.hpp’ file not found
I think that means it’s not trying to use optional in the std library, and instead trying to reference another implementation, perhaps a polyfill implementation. But how do I get it to reference std::optional? This is my CMakeLists without the above line:
cmake_minimum_required(VERSION 3.26)
project(${ProjectName})
set(CMAKE_CXX_STANDARD 20)
find_package(mongocxx REQUIRED)
find_package(bsoncxx REQUIRED)
add_executable(…)
target_link_libraries(NeuralNet_Training ${MONGOCXX_LIBRARIES} ${BSONCXX_LIBRARIES})
If anyone could help me, that would be great. Thanks!