I am trying to compile json-c-0.9 test binaries statically linking to libjson.a , which I created and sit in /path/to/json-c-0.9/lib :
$ gcc -g -v -Wall -std=gnu99 -static -L/path/to/json-c-0.9/lib -ljson test1.c -o test1
I get numerous form errors:
/path/to/json-c-0.9/test1.c:17: undefined reference to `json_object_new_string' /path/to/json-c-0.9/test1.c:18: undefined reference to `json_object_get_string' /path/to/json-c-0.9/test1.c:19: undefined reference to `json_object_to_json_string' /path/to/json-c-0.9/test1.c:20: undefined reference to `json_object_put' /path/to/json-c-0.9/test1.c:22: undefined reference to `json_object_new_string' etc.
What am I missing in trying to compile test binaries? Thank you for your advice.
c static-libraries json-c
Alex reynolds
source share