autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: library search test fails, please help


From: Keith Marshall
Subject: Re: library search test fails, please help
Date: Mon, 23 Feb 2009 16:23:01 +0000
User-agent: KMail/1.9.10

On Monday 23 February 2009 04:26:11 Peter Johansson wrote:
> aaragon wrote:
> > address@hidden:~/Lib/lib$ nm -g libcpputils.so | grep
> > flip | c++filt 00003c20 T cpputils::flip(double)
>
> Isn't the problem that flip(double) is in namespace cpputils?

Well yes, and no.  The real problem is that AC_CHECK_LIB can only be 
used effectively, when it is instructed to search for a symbol with 
`extern "C"' linkage, (and in the case of platforms such as MS-Win32, 
which make a distinction between functions with e.g. `_cdecl' and 
`_stdcall' calling conventions, that restriction is further extended 
to permit use only with `_cdecl' functions).

With C++ symbols, (and with `_stdcall' functions), the actual public 
name of the symbol, as it appears in the library, is decorated, (or 
mangled), in a fashion which can only be reproduced when a prototype 
is in scope at compile time; AC_CHECK_LIB provides no mechanism to 
specify any such prototype.  (Ok, you *might* get away with it, if 
you set the language to C++ *before* invoking AC_CHECK_LIB, and the 
symbol you are checking on just happens to fortuitously match the 
default prototype *assumed* by AC_CHECK_LIB, (which can *never* 
happen in the case of MS-Win32's `_stdcall' functions)).

Perhaps this restriction needs to be more clearly explained, in the 
autoconf manual?

-- 

Regards,
Keith.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]