mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-08-09 13:06:46 -04:00
Added instructions for compiling jsoncpp examples using g++ on MacOS with the -Wl option to avoid a "no LC_RPATH's found" error message during runtime.
parent
8a0f07e4ad
commit
a25be91024
20
Building.md
20
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: <A9CEAE97-A51C-3CE9-B1EA-9E813BD76B73> ./jsoncpp/example/readFromString/readFromString
|
||||
Reason: no LC_RPATH's found
|
||||
Abort trap: 6
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user