Processing
 

linking jsoncpp on Ubuntu

08/04/2015 15:35#1

jfjobidon

Member

Joined at: 8 months ago

Post: 1

Thank: 0

Thanked: 0

I try to use jsoncpp library with c++ on Ubuntu. I compiled the code and built the library with scons. Now I can compile a simple programme:

#include "json/json.h" #include <json/value.h> #include <json/writer.h> int main() {     return 0; } 

I use this command to compile:

g++ test.cpp -usr/lib/libjson_linux-gcc-4.8_libmt 

I conclude that the compiler knows where to find the library. The problem comes when I declare a json object:

Json::Value root; 

Then I have this error message: undefined reference to « Json::Value::Value(Json::ValueType) >>

How can I fix this problem?

23/07/2016 05:47Top#2

Eka

Member

Joined at: 11 months ago

Post: 3

Thank: 0

Thanked: 0

For CodeBlocks (Ubuntu 14.04)

I have faced same problem in my codeblocks IDE after installing jsconcpp. This is how I rectified my problem.

Got to project>Build Options>linker settings and in the link libraries add jsconcpp and click ok

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 143

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 141

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 6

Build artifacts over ssh jenkins - PHP

3 years ago - Reply: 1 - Views: 38

Can't load Metasploit after installation

3 years ago - Reply: 5 - Views: 222

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 97

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 120

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 250

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 113

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re