binary incompatibility of code compiled w/ gcc 2.96 and 3.0.4
Stephen Fromm
stephen.fromm@verizon.net
Thu Apr 17 17:58:00 GMT 2003
----- Original Message -----
From: "Andrea 'fwyzard' Bocci" <fwyzard-gcc@libero.it>
To: "Stephen J Fromm" <stephen.fromm@verizon.net>
Cc: <gcc-help@gcc.gnu.org>
Sent: Thursday, April 17, 2003 1:34 PM
Subject: Re: binary incompatibility of code compiled w/ gcc 2.96 and 3.0.4
> At 13.13 17/04/2003 -0400, Stephen J Fromm wrote:
> >I'm writing C/C++ code for a CGI program.
> >
> >[...]
> >
> >Why is this? And is there a way to run the gcc-3.0.4 binaries on the
> >webhosting site, ...
>
> GCCs before 3.2.x have different C++ ABIs, so if you call/use any external
> C++ library (say, libstdc++ :-), it won't work.
> The ABI is being standardized from 3.2.0 onwards, barring any bugfixes.
>
> >... or will I be forced to use gcc-2.96? (I'd rather not do
> >the latter, as 2.96 doesn't seem to properly deal with C++ namespaces.)
>
> If your code runs as a stand-alone executable (ie. not inside a library),
> you might try to link it statically against any C++ library, thus not
using
> the system ones.
> g++ -static should do this.
Thanks. After sending that question, I looked (further) on the web and
usenet, and what I found is similar to what you're saying.
I'll try the -static flag.
One strange thing, though, is that this problem occurred even for a simple
hello, world type program written in C, not C++. Does that mean my
installation of the C compiler and linker is linking to some C++ library, or
can these binary compatibility issues occur with C also?
Thanks,
Steve
More information about the Gcc-help
mailing list