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 `Makefile.am' should do it. > >> > >> Cheers, > >> Peter > > > > Of the suggestions offered, this one worked in the following literal > > entry into src/Makefile.am: > > > > 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