Re: library search test fails, please help

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

 



On Monday 23 February 2009 04:26:11 Peter Johansson wrote:
> aaragon wrote:
> > aaragon@aaragon-laptop:~/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.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux