JSON support

Very new here and new to C++ also :slight_smile:

Just wondering if anyone has a version of ofxJSON that works correctly as an addon with v0.061?

I have downloaded it from http://4u.jeffcrouse.info/of/ however I get numerous issues when I try to use it. Doesn’t really look like its in a state to be used as it has debugging prints in ofxJSON.cpp. I could of course be doing something wrong.

I attempted to follow the example but alas, more errors than I can poke a stick at.

Is there something else that can be used instead?

I read that someone is working on a JSON library in POCO but I can’t find if its been released yet.

try this, should be pretty useful


Thanks, yes I saw that, but I don’t have a clue how to build my project with that as part of it - like I said, pretty new to C++. Syntax makes sense to me, but linking etc… I know very little about presently.

After running make for jsoncpp I tried setting the various USER_* flags in the makefile but wasn’t able to build :frowning:

Note that I’m using Eclipse not Codeblocks (not that this should make any difference - I’m using make on the command line).

So, this is what I believe I need in my makefile:

USER_CFLAGS = -I/path/to/jsoncpp/jsoncpp-src-0.5.0/include/json  
USER_LIBS = -L/path/to/jsoncpp/jsoncpp-src-0.5.0/libs/linux-gcc-4.4.1  

  • include/json contains the header files
  • linux-gcc-4.4.1 contains .a and .so

Is that correct?

When I attempt to build I get the following:

In file included from /usr/include/X11/Xlib.h:41,  
                 from /usr/include/GL/glx.h:38,  
                 from ../../../libs/glee/include/GLee.h:66,  
                 from ../../../libs/openFrameworks/utils/ofConstants.h:100,  
                 from ../../../libs/openFrameworks/ofMain.h:6,  
                 from src/main.cpp:1:  
/usr/include/sys/types.h:158:20: error: missing binary operator before token "("  

And then a whole bunch more of similar issues.