title: JsonCpp to parse from url
body: <p>curl_jsoncpp_example.cpp : <a href="https://gist.github.com/connormanning/41efa6075515019e499c" rel="nofollow noreferrer">https://gist.github.com/connormanning/41efa6075515019e499c</a></p>
  
  <pre><code>#include &lt;json/json.h&gt; 
  </code></pre>
  
  <blockquote>
    <p>g++ main.cpp -ljsoncpp -lcurl -o example.out</p>
    
    <blockquote>
      <p>so error :
      main.cpp:8:23: fatal error: json/json.h: No such file or directory</p>
    </blockquote>
  </blockquote>
  
  <p>server did not support this, so i edited this section</p>
  
  <pre><code>#include &lt;jsoncpp/json/json.h&gt;
  </code></pre>
  
  <p>And now I'm faced with this error :</p>
  
  <pre><code>In file included from /usr/include/c++/5/cstdint:35:0,
                   from main.cpp:2:
  /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   #error This file requires compiler and library support \
    ^
  main.cpp: In function ‘int main()’:
  main.cpp:44:5: error: ‘unique_ptr’ is not a member of ‘std’
       std::unique_ptr&lt;std::string&gt; httpData(new std::string());
       ^
  main.cpp:44:32: error: expected primary-expression before ‘&gt;’ token
       std::unique_ptr&lt;std::string&gt; httpData(new std::string());
                                  ^
  main.cpp:44:60: error: ‘httpData’ was not declared in this scope
       std::unique_ptr&lt;std::string&gt; httpData(new std::string());
  </code></pre>
  
  <p>I wanted to use this <a href="https://linux.tips/programming/how-to-install-and-use-json-cpp-library-on-ubuntu-linux-os" rel="nofollow noreferrer">https://linux.tips/programming/how-to-install-and-use-json-cpp-library-on-ubuntu-linux-os</a>
  But this is only for files inside the server</p>
  
  <p>I want to get the information from a link json that is and print</p>
  
  <p>exampel json link : <a href="http://date.jsontest.com" rel="nofollow noreferrer">http://date.jsontest.com</a></p>
  
  <p>ptint json data ["time"]  C++ or C ?</p>
  
  <p>If you are familiar with PHP, this code is simply written :</p>
  
  <pre><code>&lt;?php
  $time = json_decode(file_get_contents('http://date.jsontest.com'),true);
  echo $time['time']; 
  ?&gt;
  </code></pre>
  
  <p><strong>But how to write in C++ or C ?</strong></p>
  
  <p>Please help me</p>