0

I'm using some function like json_object_get_string etc in my code and have included #include <json-c/json.h> in my code. I downloaded cjson library from following link: https://s3.amazonaws.com/json-c_releases/releases/json-c-0.13.tar.gz

I installed it after placing it in /usr/lib and following commands inside the library folder:

  1. ./configure
  2. make
  3. make install

Before installation of library,I was getting error in include statement, no such file or directory But after installation, this error is gone but i get errors like: Undefined reference to json_object_get_string and all other functions that i have used.

Can someone tell me if i'm missing something? do i need to install in some other way?

user2156513
  • 113
  • 7
  • Can you show the makefile? It seems like you're not linking it in your makefile. – thuyein Dec 19 '18 at 09:27
  • snippet of my CMakelists.txt: # specify libraries to link target_link_libraries(${PROJECT_NAME} ${SDK_SERVER_LIBRARIES} ${SDK_BASE_LIBRARIES} ${OS_LIBS} ${SDK_SYSTEM_LIBS} curl json-c ) – user2156513 Dec 19 '18 at 09:28
  • Cjson is a completely different library from what you're using, btw. – Shawn Dec 19 '18 at 09:39
  • i'm using json-c..Can you please explain what u r saying ? – user2156513 Dec 19 '18 at 09:43
  • What he's saying is that in the post title you wrote `cjson` but according to the download link, it's `json-c` which is two different library. And the snippet doesn't really help clarify your problem. You should post the CMake to your question. At least the part where those variables are defined. – thuyein Dec 19 '18 at 10:02

0 Answers0