ofxJSON/ofxJansson working example?

I have a rather easy question, can anyone give me a hint where to find an ofxJSON and/or ofxJansson example that works with the current openFrameworks0.8.0?
I’ve been searching a lot but I cannot find any one that would work…

Hi @suse_m, i’m using the ofxTwitter addon by @pelayo from this repo it use this version of ofxJSON. it works for me in Ubuntu 12.04 64 bit, but i didn’t tested in Windows or Mac ( because i haven’t it…). With which OS are you working and what type of issues are you facing?

Does that fork of ofxJSON offer anything from @bakercp’s well-maintained version or just roughly track it?

I forgot that i had an issue with it, solved here, i used it for the ofxTwitter addon see this @bakercp version is a fork of it but i can’t say much more about. Sure @bakercp will help you more.

@suse_m give my branch a try – lots of folks have been using it w/ 0.8.0 (including me) so if you can’t get it running, I’ll be happy to help figure out the problem.

ok I tried running your examples (@bakercp) but I get an error saying
#include <tr1/memory>” in ofTypes.h cannot be found
if I copy-paste the entire code into an empty example I get an json/json.h (referenced from ofxJSONElement.h") cannot be found. I checked the file is in the addon-folder, maybe in some wrong subfolder? it is in ofxJSON/libs/jsoncpp/include/json/
any ideas how to fix it?

Which Os are you using @suse_m? also may you post the log file, please? i had issues with ofxJSON as explained above. In linux64, with the jefftimesten version, i had to install json pkgs and add specific cflags and ldflags. I don’t know the reason for the error in ofTypes.h, but the second error is due to this fact. the @bakercp version should solve this with the addon_config.mk file, you don’t need to add any flags in config.make.

@kalwalt I’m on Mac OS 10.9. I don’t know what you mean by log-file?
what is the addon_config.mk file you are referring to? cannot find it in the downloaded package…
and this is my current error log:

Undefined symbols for architecture i386:
  "Json::Value::~Value()", referenced from:
      ofxJSONElement::~ofxJSONElement() in testApp.o
  "Json::Value::operator[](int)", referenced from:
      testApp::draw() in testApp.o
  "Json::Value::size() const", referenced from:
      testApp::draw() in testApp.o
  "Json::Value::operator[](char const*)", referenced from:
      testApp::draw() in testApp.o
  "Json::Value::asString() const", referenced from:
      testApp::draw() in testApp.o
  "ofxJSONElement::open(std::string const&)", referenced from:
      testApp::setup() in testApp.o
  "ofxJSONElement::getRawString(bool) const", referenced from:
      testApp::setup() in testApp.o
  "Json::Value::Value(Json::ValueType)", referenced from:
      ofxJSONElement::ofxJSONElement() in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

i’m referring to this but if you are in on Mac i think shouldn’t matter. Sorry i can’t help with Mac…

thanks for trying @kalwalt! maybe someone else has an idea?

One thing i can say, instead to copy and paste the code, use the Project generator most of the time solve many issues.

Project generator is essential for this addon … :smile: