zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.95k stars 757 forks source link

cppzmq.pc still links the binaries with the shared library libzmq.so when the --static flag os given #636

Open yurivict opened 5 months ago

yurivict commented 5 months ago

This output is wrong:

$ pkg-config --static --cflags --libs cppzmq
-I/usr/local/include -DZMQ_BUILD_DRAFT_API=1 -I/usr/local/include/pgm-5.2 -L/usr/local/lib -lzmq -lstdc++ -lpthread -lrt -L/usr/local/lib -lnorm -L/usr/local/lib -lsodium -pthread -lpgm -lm

-L/usr/local/lib -lzmq causes the toolchain to link with the shared library, and also links again with dependencies of libzmq.so, which is a bogus behavior.

These 2 arguments should be replaced with /usr/local/lib/libzmq.a for static linking.