Ubuntu: json_object_iterator.h not Found



Question:

I am trying to parse JSON object from C program. but i got following error.

my c program contains json/json.h header file. this header file is causing below error. May I need to install anything. I saw few posts related to it but not helped me to figure out the problem.

here is the Error I got while Compiling my program.

**/usr/local/include/json/json.h:27:34: fatal error: json_object_iterator.h: No such file or directory**  **compilation terminated.  make[1]: *** [cconnect.o] Error 1**  


Solution:1

14.04

You need to install the following -dev package:

sudo apt-get install libjson-c-dev  

Update (12.04)

Since libjson-c-dev is only available for 14.04, you have to install the corresponding debian packages by hand (which is not recommended).

Download the following deb packages:

Open a Terminal and go to the folder where you saved the two deb files and run:

sudo dpkg -i libjson*.deb  

Now you have /usr/include/json-c/json_object_iterator.h installed on your system.

Note that installing packages this way only works in that case because the dependencies are still satisfied on 12.04 (libc6 >= 2.14).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »