[zeromq-dev] Missing Libs.private for static link

Philip Kovacs kovacsp3 at comcast.net
Mon Feb 27 20:20:41 CET 2012


* Steven McCoy <steven.mccoy at miru.hk> [2012-02-27 13:11:58 -0500]:

> On 27 February 2012 10:20, Pierre Ynard <linkfanel at yahoo.fr> wrote:
> 
> > Hello,
> >
> > I noticed that libzmq.pc contains no Libs.private field. When trying to
> > statically link libzmq using the output of `pkg-config --static --libs
> > libzmq` I get errors due to missing library flags, at least -lrt and
> > -luuid on 2.1.
> >
> >
> The Libs.private is not backwards compatible with older versions, I think
> it's Solaris that breaks.
> 

Be careful here.  There are two .private fields in involved:

Requires.private 
Libs.private

You use Requires.private when the package makes use of another pkg-config
compatible package, but does not expose its api.  Libs.private is used for
non- pkg-config static linking, e.g. -lrt.

Since uuid is itself a pkg-config compatible package, it would belong in 
the Requires.private entry, not Libs.private.

The .private fields were introduced with pkg-config v0.20 (Oct 2005) and
are silently ignored in older versions.  There are several ways to check 
for the version of pkg-config with autotools (configure.ac). One way is 
include a recent version of pkg.m4 with the package and use this macro:

PKG_PROG_PKG_CONFIG([0.20])

The way the libzmq package is structured, you would drop pkg.m4 into the
./config directory.

Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120227/494cb646/attachment.sig>


More information about the zeromq-dev mailing list