diff --git a/Building.md b/Building.md index 56f9f2a..1889761 100644 --- a/Building.md +++ b/Building.md @@ -151,3 +151,23 @@ To get the code directly from a git repository, add a [`git_repository`](https:/ ) In either case, add `"@jsoncpp//:jsoncpp"` as a dependency to targets that use JsonCpp. + +### Building and Testing on MacOS + +On Sonoma 14.6.1 the instructions above for using meson and ninja seem to be the most straightforward way to build the libraries. + +To compile and run the examples, the following command line might be helpful as a suggestion: + + g++ readFromString.cpp -ljsoncpp -std=c++11 -o readFromString -L../../build-shared -Wl,-rpath,../../build-shared + +Including "-Wl,-rpath,../../build-shared" is there to prevent the following runtime linking error on MacOS: + + ./readFromString + dyld[21351]: Library not loaded: @rpath/libjsoncpp.27.dylib + Referenced from: ./jsoncpp/example/readFromString/readFromString + Reason: no LC_RPATH's found + Abort trap: 6 + + + +