Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2004-06-25 02:04:52

Reece Dunn wrote:

> I am not familiar with the autoconf tool, but is it possible to have
> something like this:
> // include_test.cpp
> #include <boost/regex.hpp>
> int main()
> {
> // simple regex use here
> return( 0 );
> }
> //--end
> That way, you'd get a compile error if regex.hpp is not found (Boost is
> not on the system) or a link error if the library is not available
> (library hasn't been built or configured).

right. This is the kind of code that is automatically generated by autoconf
to figure out whether

* the header exists and can be used
* the library exists and can be used

Note that in your above snippet you don't make any calls into the library,
so even though if the linker doesn't find the specified library, there
are no unresolved symbols left. Using 'AC_CHECK_LIB' will generate code
that tests for a specific function to see whether it can link with it.
However, as opposed to what the original poster said, this function doesn't
have to have C linkage (see the reference I provided in my earlier mail).


Boost list run by bdawes at, gregod at, cpdaniel at, john at