OK so after some work I finally got jansson to work with visual studio. Not sure why but for some reason visual studio did not like this #define JSON_INLINE inline inside jansson.h. Not sure why. Anyways so now I am trying to see if this will parse any json data and I have a test of json data but it fails saying "error: root is not an array". I have doubled check to make sure that it in face is a legit json (jsonlint).
char *text = 0;
json_t *root = 0;
json_error_t error;
text = "{\"glossary\": {\"title\": \"example glossary\",\"GlossDiv\": {\"title\": \"S\",\"GlossList\": {\"GlossEntry\": {\"ID\": \"SGML\",\"SortAs\": \"SGML\",\"GlossTerm\": \"Standard Generalized Markup Language\",\"Acronym\": \"SGML\",\"Abbrev\": \"ISO 8879:1986\",\"GlossDef\": {\"para\": \"A meta-markup language, used to create markup languages such as DocBook.\",\"GlossSeeAlso\": [\"GML\", \"XML\"] },\"GlossSee\": \"markup\"}}}}}";
if(!text)
return 1;
root = json_loads(text, 0, &error);
if(!root)
{
fprintf(stderr, "error: on line %d: %s\n", error.line, error.text);
}
if(!json_is_array(root))
{
fprintf(stderr, "error: root is not an array\n");
json_decref(root);
}
Thanks again for all the replies!!