[zeromq-dev] How to build with draft features?

Luca Boccassi luca.boccassi at gmail.com
Mon Apr 3 10:33:08 CEST 2017


On Mon, 2017-04-03 at 08:53 +0900, Heungsub Lee wrote:
> Thank you Loca for the answer.
> 
> Your assumptions are all true but I'm not familiar with gcc or pkg-
> config.
> 
> I tried to use pkg_config instead as you said.  But it doesn't
> produce
> `-Wl,-rpath` option so I couldn't use the draft API:
> 
> $ echo $(PKG_CONFIG_PATH=local/lib/pkgconfig pkg-config --cflags --
> libs
> libzmq)
> -DZMQ_BUILD_DRAFT_API=1 -I/home/sub/local/include
> -L/home/sub/local/lib
> -lzmq
> 
> $ gcc tmp.c $(PKG_CONFIG_PATH=local/lib/pkgconfig pkg-config --cflags
> --libs libzmq) && ./a.out
> NO DRAFT
> ./a.out: symbol lookup error: ./a.out: undefined symbol: zmq_join
> 
> 
> What am I wrong?
> 
> Regards,
> Heungsub

Check what the binary is linked against:

ldd a.out

You might have a build of the library with the same soname in your
canonical LD_LIBRARY_PATH so it gets picked instead.

Try:

LD_LIBRARY_PATH=/home/sub/local/lib ./a.out

Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170403/50523d0c/attachment.sig>


More information about the zeromq-dev mailing list