[Top][All Lists]

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

Re: Finding library procedures in /usr/local/lib/

From: Gerald I. Evenden
Subject: Re: Finding library procedures in /usr/local/lib/
Date: Fri, 3 Apr 2009 14:11:22 -0400
User-agent: KMail/1.9.10

On Friday 03 April 2009 12:17:14 pm John Calcote wrote:
> On 4/3/2009 8:49 AM, Gerald I. Evenden wrote:
> > On Thursday 02 April 2009 5:56:52 pm Peter Johansson wrote:
> >> Hello Gerald,
> >>
> >> Gerald I. Evenden wrote:
> >>> After trying so many options related to libraries I am exhausted.
> >>>
> >>> I have a simple program that needs to link with a shared library
> >>> installed in /usr/local/lib.
> >>>
> >>> When using my own simple Makefile and simply adding "-lproject -lm"
> >>> everything works fine (libproject is the shared library).
> >>
> >> LDADD = "-lm -lproject"
> >>
> >> in your `' should do it.
> >>
> >> Cheers,
> >> Peter
> >
> > Of the suggestions offered, this one worked in the following literal
> > entry into src/
> >
> > geodesic_LDADD = -lproject -lm
> No offense intended to Peter, but this solution works because it simply
> assumes the library exists on the end-user's system. On systems where it
> doesn't exist in the default library paths, the build will fail with a
> linker error. The entire purpose of Autoconf checks is to ensure that
> the environment is actually able to build the project. If this solution
> is acceptable to you, then why even bother with configure? Why not
> simply write a makefile to build your project?
> Regards,
> John

One added note, that bothers me a little.

If the system checks for an entry being present in a particular iibrary by 
compiling/linking a test program using the function *and* linking to the 
specified library,----> what if the library under test heavily references 
another library such as -lm??  IF -lm is not in the test run would the test 
not fail???????  Thus the entry under test fails also.

Just a thought.

The whole religious complexion of the modern world is due
to the absence from Jerusalem of a lunatic asylum.
-- Havelock Ellis (1859-1939) British psychologist

reply via email to

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