Public bug reported:

The static library for libyajl-dev is installed as /usr/lib/x86_64
-linux-gnu/libyajl_s.a and not /usr/lib/x86_64-linux-gnu/libyajl.a. This
means that static linking with "-lyajl" will not find it; you need to
use "-lyajl_s".

This has not been explained to pkg-config (and I suspect the pkg-config
file format can't express it). So when you do "pkg-config --static
--libs yajl", you get back "-lyajl" and not "-lyajl_s". You also get the
erroneous "-lyajl" when you ask pkg-config about anything that *depends*
on yajl, such as raptor2:

$ pkg-config --libs --static raptor2
-lraptor2 -lcurl -lxml2 -lxslt -lxml2 -lyajl

This makes pkg-config not work for linking statically against any
library that depends on yajl.

The Debian bug for this problem is at https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=877285 and has been sitting idel for several
months. I've also opened an upstream bug at
https://github.com/lloyd/yajl/issues/209 but the upstream project seems
suspiciously quiet, and I think the upstream maintainer may have quit.

I believe the actual problem with the upstream code is at
https://github.com/lloyd/yajl/blob/5e3a7856e643b4d6410ddc3f84bc2f38174f2872/src/CMakeLists.txt#L38-L40
where CMake is told to build a static library and a dynamic library with
different names. (This might be necessary on Windows, but nobody knows
how to deal with it in Linux.)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libyajl-dev 2.1.0-2
ProcVersionSignature: Ubuntu 4.4.0-124.148-generic 4.4.117
Uname: Linux 4.4.0-124-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.17
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue May 22 12:37:28 2018
Dependencies:
 gcc-6-base 6.2.0-3ubuntu11~12.04 [origin: unknown]
 libc6 2.23-0ubuntu10
 libgcc1 1:6.2.0-3ubuntu11~12.04 [origin: unknown]
 libyajl2 2.1.0-2
 multiarch-support 2.23-0ubuntu10
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-04-18 (1859 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 
(20120425)
SourcePackage: yajl
UpgradeStatus: Upgraded to xenial on 2018-02-26 (85 days ago)

** Affects: yajl (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug third-party-packages xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1772711

Title:
  Static library for libyajl is "libyajl_s.a" and pkg-config lies about
  it

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/yajl/+bug/1772711/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to