autoconf
[Top][All Lists]
Advanced

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

library search test fails, please help


From: aaragon
Subject: library search test fails, please help
Date: Sat, 21 Feb 2009 13:23:33 -0800 (PST)

Hello,

I found working with autoconf sometimes very frustrating. This is an
example. I want to check for a particular static library that I created.
Thus, I put the following in the configure.ac file

AC_CHECK_LIB([cpputils], [flip],,[AC_MSG_ERROR(library cpputils not
found)],,)

The result for this test is (in config.log):

configure:15746: checking for flip in -lcpputils
configure:15781: g++-mp-4.3 -g -O3 -o conftest -g -O2
-I/Users/aaragon/Lib/include -L/Users/aaragon/Lib/lib conftest.cpp
-lcpputils   >&5
Undefined symbols:
  "_flip", referenced from:
      _main in ccZZadrT.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure:15788: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "xGA"
| #define VERSION "0.1"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define USE_GNUPLOT 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char flip ();
| int
| main ()
| {
| return flip ();
|   ;
|   return 0;
| }
configure:15809: result: no
configure:15819: error: library cpputils not found

However, the library exits:

address@hidden/Documents/workspace/xga$ls ~/Lib/lib/
libCGAL.a               libcpputils.a           libsuperlu_3.1.a        
libyafeq.a
libblas.a               libloki.a               libxga.a

and the path as you can see above is given to the compiler with -L. So why
this test fails? Then I tried the other macro to test for libraries:

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

Again, the test failed and the result from config.log is

configure:15744: checking for library containing flip
configure:15785: g++-mp-4.3 -g -O3 -o conftest -g -O2
-I/Users/aaragon/Lib/include -L/Users/aaragon/Lib/lib conftest.cpp  >&5
Undefined symbols:
  "_flip", referenced from:
      _main in cc4yvvts.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure:15792: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "xGA"
| #define VERSION "0.1"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define USE_GNUPLOT 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char flip ();
| int
| main ()
| {
| return flip ();
|   ;
|   return 0;
| }
configure:15785: g++-mp-4.3 -g -O3 -o conftest -g -O2
-I/Users/aaragon/Lib/include -L/Users/aaragon/Lib/lib conftest.cpp
-lcpputils   >&5
Undefined symbols:
  "_flip", referenced from:
      _main in ccMrNPWx.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure:15792: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "xGA"
| #define VERSION "0.1"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define USE_GNUPLOT 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char flip ();
| int
| main ()
| {
| return flip ();
|   ;
|   return 0;
| }
configure:15823: result: no
configure:15830: error: library cpputils not found


So can someone tell me why is this happening? The result of the test doesn't
make any sense. Thanks for the help,

aa
-- 
View this message in context: 
http://www.nabble.com/library-search-test-fails%2C-please-help-tp22140739p22140739.html
Sent from the Gnu - Autoconf - General mailing list archive at Nabble.com.





reply via email to

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