[pianod] can't compile, json-c not found

Problems with packages? Post here, using [tags] of the package name.

[pianod] can't compile, json-c not found

Postby martinho » Mon Jun 24, 2013 1:09 pm

Hi there, I'm trying to compile pianod but it fails, complaining it can't find libjson.

According to this page, the dependencies needed are libao, libgcrypt, gnutls, json-c, faad2 and libmad, which I all installed.

Additionaly, this is what pacman lists as installed packages regarding json:
$this->bbcode_second_pass_code('', '
$ pacman -Qqs json
json-c
jsoncpp
perl
yajl
')

When I run ./configure it fails (I cut some stuff from the top):
$this->bbcode_second_pass_code('', '
.....
checking for gnutls... yes
checking for ao... yes
checking for mad... yes
checking for json... yes
checking for gcry_cipher_open in -lgcrypt... yes
checking for gnutls_record_recv in -lgnutls... yes
checking for json_object_new_string in -ljson... no
configure: error: Cannot find required library: libjson (aka libjson0, json-c)
')

locate libjson outputs the following:
$this->bbcode_second_pass_code('', '
$ locate libjson
/usr/lib/libjson-c.so
/usr/lib/libjson-c.so.2
/usr/lib/libjson-c.so.2.0.1
/usr/lib/libjson.so
/usr/lib/libjson.so.0
/usr/lib/libjson.so.0.1.0
')

config.log shows this about the error:
$this->bbcode_second_pass_code('', '
...
configure:4886: checking for json_object_new_string in -ljson
configure:4911: gcc -o conftest -g -O2 -std=c99 conftest.c -ljson -lgnutls -lgcrypt -lpthread -lm >&5
/usr/bin/ld: /tmp/ccYsnkBX.o: undefined reference to symbol 'json_object_new_string'
/usr/bin/ld: note: 'json_object_new_string' is defined in DSO /usr/lib/libjson-c.so.2 so try adding it to the linker command line
/usr/lib/libjson-c.so.2: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
configure:4911: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "pianod"
| #define PACKAGE_TARNAME "pianod"
| #define PACKAGE_VERSION "147"
| #define PACKAGE_STRING "pianod 147"
| #define PACKAGE_BUGREPORT "pianod@lists.deviousfish.com"
| #define PACKAGE_URL "http://deviousfish.com/pianod"
| #define PACKAGE "pianod"
| #define VERSION "147"
| #define HAVE_LIBPTHREAD 1
| #define HAVE_LIBGCRYPT 1
| #define HAVE_LIBGNUTLS 1
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char json_object_new_string ();
| int
| main ()
| {
| return json_object_new_string ();
| ;
| return 0;
| }
configure:4920: result: no
configure:4930: error: Cannot find required library: libjson (aka libjson0, json-c)
')

any idea how to fix this?
martinho
 
Posts: 1
Joined: Mon Jun 24, 2013 12:58 pm

Re: [pianod] can't compile, json-c not found

Postby sdjf » Sun Jul 07, 2013 10:18 pm

I sure am no expert at compiling C packages, but when a library cannot be found because of a slight variation in the name, sometimes making a symlink pointing to the actual library, using the name that is expected, might work. Not much to lose in trying:

I would do an ls -l /usr/lib/libjson* to see which file actually contains the binary, and then add some symblinks like maybe the following
$this->bbcode_second_pass_code('', '
ln -s FULLPATHTOACTUALLIBRARY /usr/lib/libjson-c.so.2.0
ln -s FULLPATHTOACTUALLIBRARY /usr/lib/libjson0')

That will also tell you if the above listings are for one or two library files. At this point, you cannot be sure whether your program needs one or both of them.

Or try starting compiling with strace, which will show system calls and might tell you what the actual name is of library version that is required.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: [pianod] can't compile, json-c not found

Postby WarheadsSE » Mon Jul 08, 2013 12:53 pm

Beware making these links in actual system :) Better to actually make sure it gets detected right via configure.

In the end, making a package would be best after you compilation working.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to Packages

Who is online

Users browsing this forum: No registered users and 3 guests