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

Bug#112237: compiler versions.



Daniel Jacobowitz <dan@debian.org> writes:

> On Fri, Sep 14, 2001 at 01:23:57PM -0400, Doug Alcorn wrote:
> > 
> > I forgot to add that if I link with just '-lstdc++' and not
> > '-lstdc++-2-libc6.1-2.9.0' it links fine.
> 
> Wait a second.  You didn't show how you were compiling the individual
> objects.  What version of g++ were you using for that?
> 


GCC packages installed:
ii  gcc               2.95.4-6          The GNU C compiler.
ii  gcc-3.0           3.0-0pre010403    The GNU C compiler.
ii  gcc-3.0-base      3.0.1-0pre010811  The GNU Compiler Collection (base package).
ii  gcc-2.95          2.95.4-0.010810   The GNU C compiler.

$ which gcc
/usr/bin/gcc
$ ls -l /usr/bin/gcc
lrwxrwxrwx    1 root  root  8 Aug 27 16:56 /usr/bin/gcc -> gcc-2.95*


OK, there are three components to deal with here.  Two are third party
libraries that get compiled to .a libraries.  Both use C++ and I
explicitly compile them with g++ v2.95.4.  On my previously listed
link command those would be represendted with '-lttxml' and '-lcbx'.
There are also three other .a libraries I build from our own source
code.  All of the code is C++, but I use gcc and not g++ (again
version 2.95.4).  And then there's all the actual .o files listed on
the linking command that are built with gcc (again, the files are c++)
version 2.95.4.

> You can't mix and match!  If you are going to use g++ 2.95 or 3.0 to
> compile, and want the binary to be widely distributable, I recommend
> just using -static.

The only thing we are dynamically linking against is libstdc++,
libpthread, and libm.  I suppose we could statically link against
libstdc++ and dynamic against the others (since libstdc++ is the most
problematic).  That would even allow us to go up to version 2.10.

Any tips on what command line to use for doing some libraries static
and others dynamic?  Does the '-static' flag only affect the
immediatly previous '-l...'?
-- 
 (__) Doug Alcorn (mailto:doug@lathi.net http://www.lathi.net)
 oo / PGP 02B3 1E26 BCF2 9AAF 93F1  61D7 450C B264 3E63 D543
 |_/  If you're a capitalist and you have the best goods and they're
      free, you don't have to proselytize, you just have to wait. 




Reply to: