[blfs-support] JSON-C fails to build

Chris Staub chris at beaker67.com
Fri Dec 20 23:40:19 PST 2013

On 12/20/13 13:09, Dan McGhee wrote:
> On 12/20/2013 11:41 AM, Bruce Dubbs wrote:
>>>>> I'm building JSON-C as a dependency for PulseAudio.  It fails to build with:
>>>>>> /bin/sh ./libtool --tag=CC   --mode=link gcc -Wall -Werror -Wextra
>>>>>> -Wwrite-strings -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE
>>>>>> -D_REENTRANT -g -O2 -version-info 1:0:1 -no-undefined -ljson-c  -o
>>>>>> libjson.la -rpath /usr/lib libjson.lo -ljson-c
>>>>>> mv -f .deps/json_util.Tpo .deps/json_util.Plo
>>>>>> mv -f .deps/printbuf.Tpo .deps/printbuf.Plo
>>>>>> mv -f .deps/linkhash.Tpo .deps/linkhash.Plo
>>>>>> libtool: link: gcc -shared  .libs/libjson.o   -ljson-c -Wl,-soname
>>>>>> -Wl,libjson.so.0 -o .libs/libjson.so.0.1.0
>>>>>> /usr/bin/ld: cannot find -ljson-c
>>>>>> collect2: error: ld returned 1 exit status
>>>>>> make[2]: *** [libjson.la] Error 1
>>>>>> make[2]: *** Waiting for unfinished jobs....
>>>>>> mv -f .deps/json_object.Tpo .deps/json_object.Plo
>>>>>> mv -f .deps/json_tokener.Tpo .deps/json_tokener.Plo
>>>>>> make[2]: Leaving directory `/usr/src/json-c-0.11/json-c-0.11'
>>>>>> make[1]: Leaving directory `/usr/src/json-c-0.11/json-c-0.11'
>>>>>> make[1]: *** [all-recursive] Error 1
>>>>>> make: *** [all] Error 2
>>>>> I don't know if it's relevant, but the README file contains this:
> Thanks, Bruce. I'm so locked in on getting sound that I didn't think
> about that until after I responded to Armin. First, I built and did a
> DESTDIR install as me, then a DESTIR and a final install as root. Then
> used chown to get the package user involved. There didn't seem to be any
> permissions problems.
> This is actually a mosquito bite right now. I *think* it's a path and
> permissions problem with `/usr/bin/ld.` Things worked fine when I built
> as me. When I'm through with sound and printing, I'll come back and
> troubleshoot this some more.
> Dan
I don't normally use json-c, but as I use package users myself I thought 
I'd try it. I got exactly the same build failure when I used "-j4" with 
make, and BLFS does say that this package does not support parallel 
builds. It worked fine once I removed the -j. If it worked as root it's 
probably just because you don't have MAKEFLAGS or something defined as root.

More information about the blfs-support mailing list