jsoncpp,c++语言中解析json最常用的库了,以前都是在项目中直接用。但是今天突然想单拿出来使用下,怎么编译都过不了,报错内容如下:
[root@node1 windows_share]# g++ jsoncpp_test.cc
/tmp/ccAclhTh.o: In function `main':
jsoncpp_test.cc:(.text+0x51): undefined reference to `Json::Reader::Reader()'
jsoncpp_test.cc:(.text+0x62): undefined reference to `Json::Value::Value(Json::ValueType)'
jsoncpp_test.cc:(.text+0x7e): undefined reference to `Json::Reader::parse(std::string const&, Json::Value&, bool)'
jsoncpp_test.cc:(.text+0xb2): undefined reference to `Json::Value::operator[](char const*)'
jsoncpp_test.cc:(.text+0xba): undefined reference to `Json::Value::asInt() const'
jsoncpp_test.cc:(.text+0xce): undefined reference to `Json::Value::operator[](char const*)'
jsoncpp_test.cc:(.text+0xe0): undefined reference to `Json::Value::asString() const'
jsoncpp_test.cc:(.text+0x151):