0

I just started with json a day ago and wrote this simple piece of code.

#include "json/json.h"

const char* lbuf = "[{color: 'red',value: '#f00'},{color: 'green',value: '#0f0'}]";  
Json::Value root;  
Json::Reader reader;  
bool parsingSuccessful = reader.parse(lbuf, root);  
if(!parsingSuccessful)  
{  
    std::cout << "parsing not successful";  
}  
else  
{  
    std::cout << "parsing successful";  
}  

I am getting these compilation issues.

undefined reference to `Json::Value::Value(Json::ValueType)'
undefined reference to `Json::Reader::Reader()'

Can someone help me figure it out? Thanks.

Kate
  • 21
  • 2
  • 1
    Can you properly format the code? I can't follow it the way it is displayed now. Use line breaks, and put 4 spaces before each line so that we can better read this. – Scott P Nov 17 '16 at 18:48
  • Probably unrelated to the error, but `[{color: 'red',value: '#f00'},{color: 'green',value: '#0f0'}]` is invalid JSON. – Quentin Nov 17 '16 at 19:00

0 Answers0