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

Re: weird linker problem (was: Re: Must NOT link with pthread)



On Wed, May 28, 2003 at 04:03:18PM +0200, Robert Millan wrote:
> in xfree86, the makefile calls gcc instead of g++ when it wants
> to link glxinfo. glxinfo is a C program that links against a C++ library
> (i think you've hit this one long ago, during the libio transition).

For C programs, I guess that C++ libraries are just normal shared object
files with weired names in them.  (However, I am not sure).

> the pattern that seems to be repeating is:
> 
>   liba linked against libb
> and
>   progc linked against liba
> imply:
>   to link progc, you need -la and -lb on GNU, but only -la on other systems

See my other mail.  You are always required to list all dependencies
(formally), but for shared libraries it _can_ work to let the linker find
the dependencies (and in this case, people seem to rely on it, probably
without realizing what they are doing).  This is also true on GNU, but I
suspect that the NEEDED entry for std++ is missing in the C++ library.
Now you have to look at the build rules for this library to see why.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    marcus@gnu.org
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/



Reply to: