Questions tagged [jansson]

questions about the Jansson JSON library

Jansson is a JSON library for C. See: https://github.com/akheron/jansson

35 questions
0
votes
0 answers

G++ Needs version information from /usr/local/lib/libjansson.so.4

I am using G++ ( A linux command for compiling c++ code ) to compile a project, It spat out a error saying: /usr/bin/ld: /usr/local/lib/libjansson.so.4: no version information available (required by /usr/bin/ld) I first thought that the file didn't…
What
  • 13
  • 2
0
votes
0 answers

Embarcadero C++Builder failing to create pre-compiled headers

We were migrating Jansson 2.7 to Jansson 2.14 in Embarcadero C++Builder. After successfully added to the project, we are getting the following error, which comes from Jansson -> dump.c: [bcc32 Error] dump.c(443): E2063 Illegal…
Aravind
  • 1,521
  • 2
  • 12
  • 23
0
votes
1 answer

Extract different set of keys for different nesting level of json

I have the following JSON object, from which I need to retrieve values of certain keys. For example, in outer JSON object, I need only "timestamp" and "type", next from a nested "meta" object I need only "version", and from nested "payload" I want…
yy7k
  • 61
  • 3
0
votes
1 answer

How to decode json data from google api

I'm using below code in my program to get the latitude and longitude. system("curl -d @gateway_req.json -H \"Content-Type: application/json\" -i \"https://www.googleapis.com/geolocation/v1/geolocate?key=MY_API_KEY"); This returns as below, HTTP/1.1…
Thi
  • 2,297
  • 7
  • 26
  • 36
0
votes
0 answers

Jansson build errors

I am pretty new to Linux and I am having problems integrating an external software into my program. When I am following the instructions on integrating a couple of lines that includes Jansson (Add G4Sipm to your CMakeLists.txt in this document enter…
0
votes
0 answers

How to improve this c program to avoid segmentation fault?

On every even index, i need to send the constructed json over MQTT and have to clear the json once it is sent and have to construct the json again and for the same, I am using the below script, #include #include #include…
Mahamutha M
  • 1,235
  • 1
  • 8
  • 24
0
votes
1 answer

C - How to resolve memory leaks?

Below is the part of script and the same is invoked from main function. If i comment out the below function, everything works fine without any memory leak issue, whereas by including this function, the process ends up with memory leak and eventually…
Mahamutha M
  • 1,235
  • 1
  • 8
  • 24
0
votes
0 answers

Shared library symbol conflicts - C

I have an application which is linked to json-c and a third party library. This third party library is linked to libjansson library. So when I execute my application, it crashes due to memory corruption as invalid pointer. On analysis, both the…
Vysakh A V
  • 111
  • 1
  • 11
0
votes
1 answer

How to convert librdkafka payload to json to get a parameter value?

I'm playing around with the consumer.c example file for librdkafka and I'm trying to figure out how to convert the rkm payload (that is printed out at line 244) to json so that I can grab a parameter's value from the json. Right now I'm using…
Jordan
  • 17
  • 1
  • 6
0
votes
2 answers

Unable to distinguish between JSON Object/Array/String

I am trying to use the Jansson library to parse a JSON string. I am unable to parse it correctly. Here is my code in C++ std::string JSONString = "{\"Hostages\": [{\"Rescue\": \"help me!\",\"confidence\": 0.01}]}"; json_t *JsonTable, *Rescue,…
zero-one
  • 196
  • 7
0
votes
0 answers

editing a json object with Jansson APIs

I am using jansson library, I am want to edit a Json object, how can I do this, do I have to use any specific API ?? Spare me if this question is repeated . Thanks in advance.
user_1093
  • 25
  • 4
0
votes
1 answer

json-c json_object_to_json_string() equivalent api in jansson library

In the Current code i'm using json-c. i'm migrating to jansson. need an equivalent api in jansson which converts the json_object_to_json_string. i found one but it needs a json string object otherwise it is returning null. const char…
Sridhar
  • 1
  • 2
0
votes
0 answers

When json_string() allocated memory is freed?

This is a stack trace of calling json_string() : json_string(const char *value) json_stringn(value, strlen(value)) json_stringn_nocheck(value, len) string_create(value, len, 0) string_create then call json_strndup(value,len) to duplicate value of…
H.Tibat
  • 353
  • 2
  • 9
0
votes
1 answer

jansson json_decref unexpected behavior

I am using the jansson library for a C project. I have some problem understanding how to use the decref. Shall it be used after each new json_t parameter or not? As I understand jansson will borrow references to make this simpler. If I run this…
Jacob
  • 371
  • 3
  • 12
0
votes
1 answer

Jansson on Xcode

I am trying to test Jansson on Xcode 7.3.1. I installed according to the instructions, then used cMake when that didn't work, which also didn't work. I think Xcode is having trouble finding the Jansson library. I have modified the project header…
Corry Chapman
  • 157
  • 1
  • 1
  • 10