[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: force gcc4.x to use libstdc++5
From: |
Robert Heller |
Subject: |
Re: force gcc4.x to use libstdc++5 |
Date: |
Sun, 09 Nov 2008 07:26:20 -0600 |
At Sun, 09 Nov 2008 12:24:03 +0100 Hans Schmidt <ka5427-536@online.de> wrote:
>
> Robert Heller wrote:
> > At Sun, 09 Nov 2008 00:09:50 +0100 Hans Schmidt <ka5427-536@online.de>
> > wrote:
> >
> >> Hi there!
> >>
> >> I am trying to force a gcc4.x compiler to use the libstdc++5 per default.
> >>
> >> This is needed because some "binary-only" Shared Libaries supplied by a
> >> 3rd party vendor uses libstdc++5.
> >>
> >> libstdc++5 is used by gcc-3.3 compilers - but unfortunately a gcc-4x is
> >> needed to compile the project.
> >>
> >> I spent some days of work to force a gcc-4x to use libstdc++5 per
> >> default. But I did not come closer to a solution.
> >>
> >> Do you have any ideas?
> >
> > It is not possible (as you have discovered). Versions of libstdc++ are
> > tightly tied to compiler versions. You will *have* to modify your code
> > to compile under gcc-3.3, probably by not using the features of gcc-4x
> > your project now uses -- you will have to hack around the missing
> > features.
> >
> > Either that or talk to the 3rd party vendor and try to get them to
> > re-build their libraries using gcc-4x & libstdc++6.
> >
> > Another possiblity is to build a gcc-3.3/libstdc++5 wrapper application
> > that is run as a separate process from your main gcc-4x project and pass
> > data back and forth with sockets or pipes.
> >
> >>
> >
>
> That was my concern.
>
> Regarding the gcc documentation gcc-3.3 uses abi version 1, and gcc-4.x
> uses abi version 2.
gcc-3.4 and later also use abi version 2.
>
> The gcc option -fabi-version=1 sounds like it should be possible to
> force the usage of the older abi.
>
> So I have recompiled the whole project with -fabi-version=1. But that
> seems to have no effect.
>
> What is -fabi-version used for?
Something else...
The issue with the library version has to do with name-mangling. g++ 3.x
and g++ 4.x use different name-mangling -- this means that you cannot
link g++ 4.x compiled code with a libstdc++ compiled with g++ 3.x (and
vice versa). There is no way around this. And you can't use your third
party library with g++ 4.x if it was compiled with g++ 3.x (which
appears to be the case). You *have* to use the same (major) compiler
version for your project as your third party library was compiled with
or just don't use the third party library at all.
>
>
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@deepsoft.com -- Contract Programming: C/C++, Tcl/Tk