Sunday, December 5, 2010

PKG_CHECK_MODULES for somelib++

Programmer Question

I am trying to make my autotools project in C++ link against library, that originates as C library (libsomelib.so), but also has bindings to c++ (libsomelib++.so). I ma trying to use PKG_CHECK_MODULES to check if this package is installed, and use autotools to link against it. However both libs come in one package (c++ version requires configure flag), and have only one .pc file, in which independently of configuration settings there is only line



Libs: -L${libdir} -lsomelib


without any mentioning of ++ version. There is also no separate ++.pc file that i noticed at other programs. Therefore automatic linking against ++ version is impossible. I thought about manually adding -lsomelib++ to linking flags, but that's rather ugly (and it will not work if somebody compiled it without --with-cxx flag). I could also test for it's existence by AC_SEARCH_LIBS, but since it's C++ library it's not so straightforward.



Is missing ++.pc file mistake of package distributor or is it some deeper idea, and i don't know how to use it?



If somebody is really qurious i will say that package in question is ossp-uuid.



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails