Questions tagged [libjson]

libjson is a small C library that packs an efficient parser and a configurable printer.

libjson is a small C library and small codebase that packs an efficient parser and a configurable printer.

See http://projects.snarc.org/libjson/

30 questions
13
votes
2 answers

How to free json_object?

I have the following code #include #include #include #include #include int main(int argc, char **argv) { json_object *new_obj; char buf[] = "{ \"foo\": \"bar\", \"foo2\":…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
4
votes
4 answers

Problem compiling libjson in "Release" configuration with VS2010

I downloaded the libjson package and added it to my VS2010 projects folder. I created a new project called checkJson and added the following code: #include "../../libjson/libjson.h" int main(){ return 0;} When I compile I get an error : "Release…
mynameisalon
  • 165
  • 2
  • 7
4
votes
1 answer

Does libjson support 64 bit int types?

I am trying to push a 64 bit integer data to a JSONNode using json.push_back call uint64_t myHigh = 0x10; uint64_t myLow = 0x12; uint64_t myFinal = 0; myFinal = (myHigh << 32) | myLow ; std::cout << "val = 0x" <<…
payyans4u
  • 351
  • 2
  • 5
  • 16
4
votes
3 answers

How to get json values after json_tokener_parse()?

I have the following code #include #include #include #include #include int main(int argc, char **argv) { json_object *new_obj; char buf[] = "{ \"foo\": \"bar\", \"foo2\":…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
3
votes
3 answers

How to create a libJSON library?

I downloaded C++ libJSON from this link: And they suggest me to use it as a library. How can I create library using the code they have provided?
RK-
  • 12,099
  • 23
  • 89
  • 155
2
votes
1 answer

How create an array using libjson?

I want to make an array with libJSON's JSONNode. I've tried the following, but it doesn't work: JSONNode array; JSONNode foo("word", "foo"); JSONNode bar("word", "bar"); array.push_back(foo); array.push_back(bar); This results in: { "word":…
Neko
  • 3,550
  • 7
  • 28
  • 34
2
votes
2 answers

How to install AWS CloudHSM on Ubuntu 18.04 TLS? (requires libjson-c2 but only libjson-c3 available)

I am trying to install Amazon AWS CloudHSM on AWS EC2 instances running Ubuntu 18.04 LTS. The instructions from Amazon seem to require an older library libjson-c2, but only the newer library libjson-c3 is available for Ubuntu 18.04 LTS. Amazon link:…
David Jones
  • 2,139
  • 2
  • 19
  • 20
2
votes
1 answer

With Iibjson try, catch is not working, in target Cross compiled linux board

I have a try catch inside a contructor in C++ class class jsonAdap { jsonAdap(const char *text) { try { parsejson(text);//this calls a libjson function that throws the expection throw std::invalid_argument("exception") } …
buddy
  • 805
  • 1
  • 15
  • 30
2
votes
1 answer

Invalid inputs causes authentication bypass in polyglot JSON messaging system?

This is a very simple system based on sending JSON messages that seems to have a security vulnerability. There is a Python server (using JSON module included in standard library) which receives JSON objects and acts on them. If it gets {"req": …
Dog
  • 7,707
  • 8
  • 40
  • 74
2
votes
2 answers

Error in getting the array out of JSON string

I am trying to get the array from my JSON Stinrg defined in the main function. I have used libjson API for this, simple key value is easy to get so I am able to get the value of RootA but how about this array in ChildA. Please let me know #include…
user2431227
2
votes
2 answers

compile in eclipse using c++

I'm trying to include and compile #include However even though I've installed it and included it on the project settings it wouldn't find the path. here's what I've so far done: path to libjson: …
Alon_T
  • 1,430
  • 4
  • 26
  • 47
2
votes
3 answers

Using libjson in a C++ project

I'm trying to use libjson within a C++ project and the docs tell me to just "add libjson's source to your project, comment JSON_LIBRARY in the JSONOptions.h file and any C++ compiler should compile it." Being quite new to C++ and all that, how…
DeX3
  • 5,200
  • 6
  • 44
  • 68
1
vote
1 answer

How to create libjson.lib using makefile on windows?

I downloaded C++ libJSON from this link: https://sourceforge.net/projects/libjson/ How can I create a library using the code they have provided? I installed MinGW, added it to the path in the environment variable and did cd to the directory, where I…
coral
  • 181
  • 1
  • 1
  • 12
1
vote
1 answer

Building with libjson on OSX Mavericks

I've tried the advice on threads here and here to no avail. I have Xcode 5.0.2 installed and I am compiling everything on the command line. After make/make install to build libjson, I created a simple test file to link and build from it: #include…
omikun
  • 273
  • 1
  • 2
  • 14
1
vote
1 answer

creating a libjson library to link to xcode

I apologize in advance for the possibly noobish question but I could not find the answer to this anywhere on the internet or SO for the past few days of looking. I'm trying to create a c++ project in xcode and I want to use libjson to parse my json…
ThinkBonobo
  • 15,487
  • 9
  • 65
  • 80
1
2