title: How do I use a shared library (in this case JsonCpp) in my C++ program on Linux?
body: <p>I'm a new-ish C++ programmer, and I'm doing my first program on my own using C++. I decided I would like to use JSON to store some of the data I'm going to be using, and I've found a library to handle JSON, <a href="http://jsoncpp.sourceforge.net/" rel="nofollow noreferrer">JsonCpp</a>.</p>
  
  <p>I've installed the library using my Linux system's package manager, and in my C++ code, I've used in my source code file</p>
  
  <pre><code>#include &lt;json&gt;
  </code></pre>
  
  <p>and compiled it using g++ and it's -ljson and -L/usr/lib options (libjson.so is located in <code>/usr/lib</code>).</p>
  
  <p>However, the first usage of Json::Value, an object provided by the library, gives a compilation error of "Json has not declared". I'm sure my mistake is something simple, so could someone explain what I'm doing wrong? None of the books I had mention how to use shared libraries, so I've had to google to find this much. </p>
  
  <p>EDIT: g++ with the -E option gives this error: </p>
  
  <blockquote>
    <p>json: no such file or directory.</p>
  </blockquote>