What am I missing in compiler options for linking with JSON-C static library?
With static linking, gcc only tries to bring in the symbols it needs based on what it has encountered already. In your case, you pass -ljson
before your source files, so gcc brings in the static library and doesn't need anything from it, then tries to build your code.
Put the libraries to link against after your code.
$ gcc -g -v -Wall -std=gnu99 -static -L/path/to/json-c-0.9/lib test1.c -o test1 -ljson