title: JsonCpp: Undefined reference to `Json::Value::operator[](int) const'
body: <p>i'm trying to use JsonCpp with this sample code</p>
  
  <pre><code>string json_example = "{\"array\":[\"item1\", \"item2\"], \"not an array\":\"asdf\"}";
  
  
      // Let's parse it
      Json::Value root;
      Json::Reader reader;
  
  
      //Parsing of something. In example do parsing of json_example string.
      bool parsedSuccess = reader.parse(json_example, root, false);
  
      if (!parsedSuccess) {
          // report to the user the failure and their locations in the document.
          cout  &lt;&lt; "Failed to parse JSON" &lt;&lt; endl &lt;&lt; reader.getFormatedErrorMessages() &lt;&lt; endl;
          return 1;
      }
  
      // Let's extract the array that is contained inside the root object
      const Json::Value array = root["array"];
  
      // And print its values
      for (int index = 0; index &lt; array.size(); ++index) {   // Iterates over the sequence elements.
          cout &lt;&lt; "Element " &lt;&lt; index &lt;&lt; " in array: " &lt;&lt; array[index].asString() &lt;&lt; endl;
      }
  
      // Lets extract the not array element contained in the root object and print its value
      cout &lt;&lt; "Not an array: " &lt;&lt; root["not an array"] &lt;&lt; endl;
  
      // If we want to print JSON is as easy as doing:
      cout &lt;&lt; "Json Example pretty print: " &lt;&lt; endl &lt;&lt; root.toStyledString() &lt;&lt; endl;
  
      return 0;
  </code></pre>
  
  <p>but i've received this error on this "..array[index].asString..."</p>
  
  <pre><code>Undefined reference to `Json::Value::operator[](int) const'
  </code></pre>
  
  <p>can anyone help me?!tnx so much</p>