Ramesh - 2013-03-27

Hello,

In order to improve performance of my application,   enabled JSON_PREPARSE option in the JSONOptions.h file

After enabling I am getting the following error:

/tmp/ccsYKCLL.o: In function `libjson::parse(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
preparse.cpp:(.text+0xe0): undefined reference to `JSONPreparse::isValidRoot(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: ld returned 1 exit status

Here is the simple sample program:

int main ()
{

   JSONNode testNode(JSON_NODE);
   testNode.set_name("PreparseTest");
   testNode.push_back(JSONNode("String Node 1","JSON CPP"));
   testNode.push_back(JSONNode("String Node 2","Library:"));
   testNode.push_back(JSONNode("String Node 3","libjson"));
   std::string jsonText = testNode.write_formatted();

   JSONNode infoNode=libjson::parse(jsonText);
   JSONNode::iterator it=infoNode.begin();
   for(;it!=infoNode.end();++it)
   {
      cout<<it->as_string()<<endl;
   }
}

What could be the reason for the error ? can anyone share a sample C++ interface program  when JSON_PREPARSE is enabled ?

Thanks,