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: Peter Johansson
Subject: Re: library search test fails, please help
Date: Mon, 23 Feb 2009 11:02:05 -0500
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hello,

[adding autoconf list again]

Alejandro Marcos Aragón wrote:
Well, I tried to put the namespace as well, but the test failed.

I suppose you mean that you tried

AC_SEARCH_LIBS([cpputils::flip], [cpputils],,[AC_MSG_ERROR(library cpputils not
found)])


which would result in test code:

char cpputils::flip ();
int
main ()
{
return cpputils::flip ();
  ;
  return 0;
}


which is not what we desired. We would like something like (I'm not certain of your exact signature):

namespace cpputils {
void flip (double);
}
int
main ()
{
using namespace cpputils;
flip (1.0);
  ;
  return 0;
}


You could achieve this by rather calling AC_LINK_IFELSE as below

LIBS="$LIBS -lcpputils"
AC_MSG_CHECKING([for flip in cpputils])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
                                 namespace cpputils {
                                 void flip(double);
                                 }
                               ]],
                               [using namespace cpputils;
                                flip(1.0);])
              ],
              [AC_MSG_RESULT([yes])],
              [AC_MSG_RESULT([no])
               AC_MSG_ERROR([library cpputils not found])
              ]
             )


Hope that helps.


Peter



aa

On Sun, 2009-02-22 at 23:26 -0500, 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?

Peter



--
Peter Johansson

svndigest maintainer, http://dev.thep.lu.se/svndigest
yat maintainer,       http://dev.thep.lu.se/yat





reply via email to

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