Bug#112237: compiler versions.
On Fri, Sep 14, 2001 at 02:32:23PM -0400, Doug Alcorn wrote:
> 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.
It doesn't matter whether you build with gcc or g++. In fact, for
compile-only, I think it makes not the slightest difference. g++
2.95.4 compiled code will NOT run if linked against libstdc++ 2.9. It
just won't happen.
> > 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...'?
No. But you can link to libstdc++.a explicitly.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
Reply to: