Questions tagged [cjson]

cJSON aims to be the dumbest possible parser that you can get your job done with. It's a single file of C, and a single header file.

cJSON aims to be the dumbest possible parser that you can get your job done with. It's a single file of C, and a single header file.

110 questions
1
vote
1 answer

Trying to import cjson in a Maya 2018 Python environment

I'd like to use cjson in Maya 2018 but I'm running into some trouble. The original tool seems to be 32-bit compiled (https://pypi.org/project/python-cjson/) so I looked around and found a version that was compiled in 64-bit from…
Nodgers
  • 177
  • 1
  • 13
1
vote
2 answers

cJSON build an array?

Well, I am a newer with cJSON. I want to build a JSON format data, like this: { "parmas": { "name":"testbox", "box1":[0,0], "box2":[2,2] } } So, How should I implement it with cJson.c…
Davonter
  • 11
  • 1
  • 3
1
vote
1 answer

Lua nested Json, remove single occurs or list of occurs if multiple

So what I am trying to do here is for a given json_body which is decoded json into a table using cjson I want to remove a given element by a configurable value conf.remove.json, I feel I am pretty close but its still not working, and is there a…
1
vote
1 answer

C++ call lua_dostring to load lua scrip which has 'require('cjson')' raise error:cjson.so: undefined symbol: lua_getfield

I define a function In a Lua Script and call it from my C++ program. The Lua Script use cjson module. I can executes the Lua script by Lua bin, but it can't run in my C++ program. Error Message: error loading module 'cjson' from file…
cswuyg
  • 56
  • 5
1
vote
1 answer

JSON string fails to convert to correct Lua table

I'm performing a request to a foreign API using luasec, lua-socket and converting the data, a JSON string, to a lua table with cjson. I've read the docs of said modules and unfortunately none of it helped me with my problem. Can't link more than 2…
1
vote
1 answer

JSON array with multiple values c++

I have this body request example: { "users": [{ "userId": 123 }, { "userId": 1234 }] } For the previous example I receive one std::list* VUsers that have my userId (in this case '123' and '1234'), create cJSON…
Pik93
  • 49
  • 1
  • 2
  • 12
1
vote
1 answer

cJson how to compute length of print buffer

I'm using cJson for C, into an embedded platform, to build a JSON like this: {"ProtocolVersion":1,"ID":"123","Zone":"xyz","MessageType":42,"Message":"Json payload MSG #6"} To do this I use this function provided by cJson: jsonObject =…
Federico
  • 1,117
  • 6
  • 20
  • 37
1
vote
1 answer

cJSON error while compiling and printing file

I recently installed the cJSON library by David Gamble via Cmake and I am getting the following errors: gcc prueba.c -lm -o prueba /tmp/ccdmegU5.o: In function `main': prueba.c:(.text+0x2e): undefined reference to…
Tomás Torres
  • 21
  • 1
  • 3
1
vote
4 answers

cJSON.h: No such file or directory

I had too many problems with compiling different libraries for json and finally I got an already compiled library of json which is cJSON to be linked with my project but when I downloaded it, and linked it with a test c file like: //file1.c …
Zainab
  • 49
  • 2
  • 7
1
vote
2 answers

parse json arrays using cJSON library

First off, this is a very broad question, and it might come across as me asking for the community to write my code for me. That is not my intent, but I am so lost, I don't know how to give enough information. I am attempting to use the cJSON…
indra
  • 832
  • 4
  • 17
  • 33
0
votes
0 answers

Getting [ModuleNotFoundError: No module named 'passlib'] this even passlib is already installed

cjson not found, falling back to stdlib json Traceback (most recent call last): . . from Crypto.Hash import HMAC, SHA256, SHA384, SHA512 ModuleNotFoundError: No module named 'Crypto also, from passlib.context import…
0
votes
1 answer

Using Item from Hashmap causes segmentation fault

I am trying to fill a hashmap of Spritesheets. The data for the Spritesheet is read from a json file. I am using hashmap.c for the hashmap and cJSON for parsing the json data The SpriteSheet struct typedef struct { char* name; char* path; …
Techie-Guy
  • 131
  • 8
0
votes
0 answers

Why isn't cJSON parsing a heap buffer?

I want to parse a json data obtain from a server using cJSON, this is how the data looks like { "ID": "2", "Success": "Updated" } using this code it works fine int main() { char ptr[] = "{" "\"ID\": \"2\"," …
loaded_dypper
  • 262
  • 3
  • 12
0
votes
0 answers

how to create json more pretty using cJSON.h

I want to create JSON like this: 1 line each two items (ip and status). [ {"ip" : "10.1.11.3","status": "Normal"}, {"ip" : "10.1.11.3","status": "Normal"}, ] But the my output does not pretty like below. [{ "ip": …
JK Lee
  • 1
  • 1
0
votes
0 answers

Parsing longer libcurl responses with cJSON_Parse() sometimes produces broken object

So I'm making a C program using cJSON and curl. In the curl process itself, I need to send a GET request to an API, and the request link itself would be…
alfredapri
  • 3
  • 1
  • 2