Re: library search test fails, please help

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

 



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:
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?

Peter



--
Peter Johansson

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



_______________________________________________
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