json-c will install into /usr/local by default, so you either need to tell that stackoverflow-cli build to look there for it (through configure options, or perhaps CFLAGS) or build and install json-c with a "--prefix=/"
Eric
json-c will install into /usr/local by default, so you either need to tell that stackoverflow-cli build to look there for it (through configure options, or perhaps CFLAGS) or build and install json-c with a "--prefix=/"
Eric
On Fri, Nov 27, 2015 at 2:32 AM, <amigode...@gmail.com> wrote:
> Fixed this by changing #include <json/json.h> to #include <json-c/json.h>. I wonder when the renaming happened.
>
> Now I'm getting this error instead:
> cc -o stackoverflow-cli -ljson -lcurl stackoverflow.o requests.o arguments.o stackoverflow-cli.o
> /usr/bin/ld: cannot find -ljson
>
Oh, that's the same "problem", just on the link side. We changed the name of the library from "json" to "json-c" to help avoid conflicts with other json libraries. Unsurprisingly, many of them use "libjson.so", which can cause various hard to puzzle out errors.
You should just change whereever in the stackoverflow-cli makesfiles it says "-ljson" and use "-ljson-c".
Eric
> Fixed this by changing #include <json/json.h> to #include <json-c/json.h>. I wonder when the renaming happened.