[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Check for a library with C++ code
From: |
Ossama Othman |
Subject: |
Re: Check for a library with C++ code |
Date: |
Sat, 28 Sep 2002 14:12:28 -0700 |
User-agent: |
Mutt/1.3.28i |
Hi Sebastian,
On Sat, Sep 28, 2002 at 06:20:36PM -0700, Sebastian Huber wrote:
> how can I write a check for a library which contain only functions and
> classes
> in a namespace?
> The easiest function is 'std::string TACO::errorString( long e)'.
>
> I tried this:
>
> AC_CHECK_LIB(TACOExtensions,errorString,found=yes,found=no,)
>
> but it resulted in:
>
> /home/huber/taco/frmII/tacodevel/build/client/io/configure:2971: undefined
> reference to `errorString'
AC_CHECK_LIB uses a test program that assumes that the function you're
looking for has a C linkage. Unless your C++ function has a C linkage
(e.g. via the extern "C" linkage directive), AC_CHECK_LIB will fail.
The test employed by AC_CHECK_LIB generally isn't suitable for methods
in C++ classes, C++ templates, etc due to the name mangling performed
by the compiler.
AFAICT, you'll have to write a custom test using something like
AC_TRY_LINK. Make sure you set the test language to C++.
HTH,
-Ossama
--
Ossama Othman <address@hidden>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068 70E6 5EB7 5E71 F7A3 94A8