0

I'm running on Mac OSX, and have a very simple C++ project where I want to use the library jsoncpp.

Stripped back, this is what I have:

main.py

#include <json/json.h>

...

CMakeLists.txt

cmake_minimum_required(VERSION 3.14)
project(MyProject)

set(CMAKE_CXX_STANDARD 17)

add_executable(MyProject main.cpp)

target_link_libraries(MyProject jsoncpp)

Attempting to build this results in the following fatal error:

fatal error: 'json/json.h' file not found

I assumed this is due to jsoncpp not being installed on my machine by default, therefore I installed it via the command brew install jsoncpp. I could then see what I presume are the newly installed header and object files in /usr/local/include/json/*.h and /usr/local/lib/*.dylib respectively.

However despite this I still get the same fatal error. Can anyone lend a helping hand?

This may be simple but I'm fairly new.

numberjak
  • 1,065
  • 4
  • 13
  • 28

0 Answers0