While following this link to setup boost for json parsing, I am unable to find the boost json component.
Link: Using boost::json static library with cmake
Here's my CMakeLists.txt:
cmake_minimum_required(VERSION 3.9) set (CMAKE_CXX_STANDARD 14) set( Boost_USE_STATIC_LIBS ON ) #set( Boost_USE_MULTITHREADED ON ) #set( Boost_USE_STATIC_RUNTIME OFF ) find_package( Boost REQUIRED COMPONENTS json ) if ( Boost_FOUND ) include_directories( ${Boost_INCLUDE_DIRS} ) else() message( FATAL_ERROR "Required Boost packages not found. Perhaps add -DBOOST_ROOT?" ) endif() add_executable (test main.cc) target_include_directories(test PUBLIC ${Boost_INCLUDE_DIRS}) target_link_libraries(test PUBLIC Boost::boost Boost::json) Error:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package): Could not find a package configuration file provided by "boost_json" (requested version 1.71.0) with any of the following names: boost_jsonConfig.cmake boost_json-config.cmake Add the installation prefix of "boost_json" to CMAKE_PREFIX_PATH or set "boost_json_DIR" to a directory containing one of the above files. If "boost_json" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component) /usr/share/cmake-3.16/Modules/FindBoost.cmake:443 (find_package) CMakeLists.txt:11 (find_package) -- Configuring incomplete, errors occurred How do I resolve this error? I did go through some of the posts describing similar issues with boost but nothing worked.