Hi, A while ago I wanted to find out how to check for C++ libraries using autoconf, and came across this old post from the archives:
>On Thu, Mar 28, 2002 at 07:13:14PM -0500, Allan Clark wrote:
>
>> How do I make a AC_CHECK_LIB for a C++ library?
>>
>> My example looks for cgi_base::configureForServer on different systems
>> like this:
>> > AC_CHECK_LIB(cgi, configureForServer__8cgi_basePci)
>> > AC_CHECK_LIB(cgi, configureForServer__8cgi_baseFPci)
>
>First do AC_LANG_CPLUSPLUS (or the equivalent) to switch to compiling >in
>C++).
>
>Then you can simply do :
>
>AC_CHECK_LIB(cgi, main)
>
>(yes, using "main" works - it's a special value in this context).
I've used this happily until now. What this test seems to do is try a
program like the following:
int main() {
return main();
};
The problem is that this is illegal in ISO C++. gcc doesn't complain
unless run with --pedantic, but the compiler I'm using now (IBM Visual
Age C++ xlC) will not accept calling main.
So, can anyone give me another way of testing for a C++ library, without
using main or mangled function names? I've searched around the web for
this and found nothing, but it seems it should be a pretty obvious issue.
Thanks,
/Patrik Jonsson
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list [email protected] http://lists.gnu.org/mailman/listinfo/autoconf
