我正在尝试编译json-c-0.9
测试二进制文件,同时静态链接到libjson.a
我已经构建并位于其中的/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
我收到许多表格错误:
/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.
我在尝试编译测试二进制文件时缺少什么?谢谢你的建议。