autoconf
[Top][All Lists]
Advanced

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

Re: trouble searching for libs


From: Andre Caldas
Subject: Re: trouble searching for libs
Date: Tue, 07 Sep 2004 11:04:40 +0900
User-agent: Mozilla Thunderbird 0.7 (X11/20040615)

P.S. -   When I set, in configure.in,

AC_CHECK_LIB(mylib,main)

(since AC_HAVE_LIBRARY is now deprecated...), then when I run ./configure, it says, e.g

configure: checking for main in -lmylib....no


...I'm confused as to what this is telling me. I don't see why I should be looking for "main" in a library that HAS no main, but that's what the docs I read said to do. Anyway, I think configure is failing to look in /usr/local/lib, where I've put my library.

Hello, Scott!

        The AC_CHECK_LIB is trying to locate the function main inside your
library because that was what you told it to do!
        In order to check for the lib, autoconf does not only checks for the
existence of the file. It also tries to "link" against some test
program. The second argument to AC_CHECK_LIB is the name of a function
(any function) _inside_ your library. If your library contais a function
called myfunc, then you should do like:

        AC_CHECK_LIB(mylib, myfunc)

        In this case autoconf will create some "test.c" which will contain a
main function that calls _your_function_myfunc_. Then it will compile it
and try to link it against your library.

        I think you got a little confused because the manual for
AC_HAVE_LIBRARY says: "This macro is equivalent to calling
`AC_CHECK_LIB' with a FUNCTION argument of `main'". You guessed that
calling AC_CHECK_LIB(mylib, main) should work! I think you are not wrong
in what you concluded. Maybe the implementation of AC_CHECK_LIB changed
since then...

Any way, good luck.

Andre Caldas.





reply via email to

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