title: Json::Value::resolveReference(key, end): requires objectValue
body: <p>Using jsoncpp, I am creating a JSON object.</p>
  <pre><code>   Json::Value root;   
     Json::Value zone1;
     Json::Value coord;
     Json::Value gridOrigin;
     
     JSON_PEOPLE(){
       zone1[&quot;zoneID&quot;] = &quot;shop1&quot;;
       zone1[&quot;stamp&quot;] = &quot;##########&quot;;
       zone1[&quot;gridSizeX&quot;]=50;
       zone1[&quot;gridSizeY&quot;]=50;
       zone1[&quot;gridScale&quot;]=0.5;
       zone1[&quot;gridOrigin&quot;].append(28.5);
       zone1[&quot;gridOrigin&quot;].append(20.6);
     }
     
     std::string get_time_stamp()
     {
        time_t rawtime;
        std::time(&amp;rawtime);
        struct tm *tinfo = std::localtime(&amp;rawtime);
        char buf[50];
        strftime(buf, sizeof(buf), &quot;%Y-%m-%d %H:%M:%S&quot;, tinfo);
        return std::string(buf);   
  
     }
     std::string updateZone (std::vector &lt; std::pair &lt;int,int&gt; &gt;  &amp;world_coords){ 
        zone1[&quot;stamp&quot;]=get_time_stamp(); 
        coord.clear();
        zone1[&quot;detected_people&quot;].clear();
        for(int i=0; i &lt; world_coords.size(); i++){
           Json::Value person;        
           person.append(world_coords[i].first);person.append(world_coords[i].second);
           coord[&quot;coordinates&quot;].append(person);
        }
        zone1[&quot;detected_people&quot;] = coord;
        root[&quot;zone1&quot;]=zone1;
        Json::StreamWriterBuilder builder;
        const std::string json_file = Json::writeString(builder, root);
        return json_file;      
     }
  </code></pre>
  <p>I have error at <code>root[&quot;zone1&quot;]=zone1;</code></p>
  <pre><code>terminate called after throwing an instance of 'Json::LogicError'
    what():  in Json::Value::resolveReference(key, end): requires objectValue
  Aborted (core dumped)
  </code></pre>
  <p>What could be wrong?</p>