akheron / jansson

C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
Other
3.05k stars 809 forks source link

undefined reference to `json_object' #553

Closed celiajoseph closed 3 years ago

celiajoseph commented 3 years ago

i am using jannson on cortex M7 processor and have successfully installed it.

static json_t* root; root = json_object();

This is the sample program i was trying to build and i get the undefined reference error. i do not get any error on the json_t only on this object and any other objects i use for example jason_integer(). I do use the -ljansson flag on my cmake file. I am somehow able to link to jansson.h but not to the value.c file that contains the definition of json_object(). Please do help me with this issue.

Thanks in advance Celia Joseph

celiajoseph commented 3 years ago

on giving the path to libjansson.a file in the target_link_options() in the cmake file, i was able to solve this issue.