in reply to Re^4: Error during compilation of 5.8.8 on solaris 10
in thread Error during compilation of 5.8.8 on solaris 10

> The previous comments about needing libdb.a instead of libdb.so were incorrect.

The documentation says you're wrong; the '-l' option explicitly requires the '.a' version.


-- 
Human history becomes more and more a race between education and catastrophe. -- HG Wells
  • Comment on Re^5: Error during compilation of 5.8.8 on solaris 10

Replies are listed 'Best First'.
Re^6: Error during compilation of 5.8.8 on solaris 10
by Sinistral (Monsignor) on Apr 10, 2008 at 19:08 UTC

    Your documentation link went to the original parent node. A little searching shows this: http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Link-Options.html#Link-Options being what you're citing.

    I see what you're saying, but notice this option:

    -static On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option has no effect.

    Personal experience with GCC (including and especially on Solaris) indicates that if you have libname.so and libname.a, then the .so is preferred when building.

    If you only linked against libname.a, then you wouldn't need the -static command line flag.

Re^6: Error during compilation of 5.8.8 on solaris 10
by Anonymous Monk on Apr 10, 2008 at 19:26 UTC

    From the linker's (GNU ld) man page (remember, link options are just being passed through to the linker):

    -larchive
    --library=archive
    
    Add archive file archive to the list of files to link.  This option
    may be used any number of times. ld will search its path-list for
    occurrences of "libarchive.a" for every archive specified.
    
    On systems which support shared libraries, ld may also search for
    libraries with extensions other than ".a".  Specifically, on ELF and
    SunOS systems, ld will search a directory for a library with an 
    extension of ".so" before searching for one with an extension of ".a". 
    By convention, a ".so" extension indicates a shared library.