[prog] GNU autotools and namespaced libraries

Meredith L. Patterson mlp at thesmartpolitenerd.com
Thu Dec 16 13:10:33 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I'm trying to write a configure.in for a C++ project which relies on
several libraries, including libpqxx. The AC_CHECK_LIB macro works just
fine for most of the libraries, but it fails for libpqxx because all the
functions for that library reside in the "pqxx" namespace, and as far as
I've been able to tell, there are no parameterless functions that don't
rely on other functions within the namespace (most of the parameterless
functions are actually member functions, which isn't too surprising).
Naturally, the check fails even if I scope the function I'm using as a
parameter for AC_CHECK_LIB (e.g. pqxx::is_open), because when the
configure script tries to compile a trivial program incorporating that
function, none of the namespaced functions it depends on are found and
the compilation dies.

I suppose I could write my own macro which parallels AC_CHECK_LIB but
also incorporates a "using namespace $foo", but before I go to all that
trouble, I thought I'd check and see if anyone had run into a similar
problem and/or knows of a canonical solution. Any ideas?

Thanks,
Meredith
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBwO6ZsrMg4RkUokIRAqS1AKCIWJ+2IGfcCSXvLqoOYtAA8eJo5wCfUAiD
OWRWKwzj643xkwZIW9yRWOQ=
=Lo5r
-----END PGP SIGNATURE-----


More information about the Programming mailing list