[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Checking lib requires include
From: |
Ralf Wildenhues |
Subject: |
Re: Checking lib requires include |
Date: |
Sat, 12 Nov 2005 15:04:40 +0100 |
User-agent: |
Mutt/1.5.9i |
Hi Paulo,
* Paulo Jorge Matos wrote on Thu, Nov 10, 2005 at 06:42:00PM CET:
> On 10/11/05, Paulo Jorge Matos <address@hidden> wrote:
> >
> > The problem is I'm checking for a library using AC_CHECK_LIB and I was
> > expecting to be able to say: (glpk - gnu linear programming kit)
> > AC_CHECK_LIB(glpk)
> > and that's it. However, I need to also give a function name. Why?
Some linkers do not error out if the named library was not found but
also not used to satisfy a certain symbol. (At least I believe so.)
> > I imagine this is the only way to check if the library is linkable...
> > so, I asked for lpx_create_prob. (does this function need any
> > particular feature?)
> > Still config.log says it does not work because the test program needs
> > to include glpk.h.
I don't think this is the exact error it gives.
If lpx_create_prob is a function in libglpk, that should work.
It may be that they used a macro to define it in some header file.
Then use a different function that is not implemented as a macro.
But the error you are citing from comes most likely from a different
test. It is usually better to quote (copy and paste from config.log)
error messages, so possible misunderstandings are avoided.
> > How can I tell that to autoconf?
>
> Oh well, this is a quite nice trick.
> Checking for main, i.e.
> AC_CHECK_LIB(glpk, main)
This is not a trick. This is plain broken.
There is no need for Autoconf if you are going to disable its primary
use anyway. Might as well just set
LIBS="-lglpk $LIBS"
right away instead of invoking AC_CHECK_LIB.
Cheers,
Ralf