How can I link jsoncpp with a C++ program using g++? I tried:
g++ -o program program.cpp -L/path/to/library/files -ljsoncpp, -ljson, -llibjsoncpp
but g++ keeps saying:
/usr/bin/ld: cannot find -lsomething
Look in /path/to/library/files
to see what your *.a
file is really named. On my system, I link with:
-ljson_linux-gcc-4.4.3_libmt
Some libraries will create a link from lib<name>.a
to lib<name>-<version>.a
for you, but I don't think that jsoncpp does this automatically. Therefore, you need to specify the complete name when linking.