Re: GNU C++ 3.0 porting help wanted
On Tuesday 09 October 2001 17:46, peter karlsson wrote:
> Hi!
Salu!
>
> I am currently having problems trying to get one of my packages
> (turqstat) compiled due to problems with changes in GNU C++ 3.0.
> Unfortunately, I don't really know enough of the changes (especially to
> the standard library) to fix it, which is quite a shame, given that I
> wrote the program myself... :-/
>
You're missing the important part: what problems are you experiencing ?
> Anyway, if anyone could help getting it up and running on g++3, I would
> be very grateful.
>
There are various issues when switching from g++ 2.x to 3.0, most of them are
trivial to fix, for one other I have almost given up hope for a fix.
The trivial ones are the much stricter checking done by 3.0 . When
#include <vector.h>
vector<int> vec;
worked with 2.x, it is simply wrong C++ (read: not according to the
ISO-norm). Instead, you have to use
#include <vector>
std::vector<int> vec;
with 3.0. IIRC, with 2.x, the namespace std was #defined to "" and therefore
de facto not existant.
Another issue I found is related to the name-mangling [1] of C++-symbols. The
changes between 2.x and 3.x are intentionally incompatible, because the
ABI[2] changed too. I found this problem when trying to link with wxWindows,
a C++ class-library. The problem will probably only be solvable by
recompiling wxWindows with g++-3.0 but that too will result in an not
backward-compatible change; I have not the foggiest when this will happen nor
how this transition will be handled (anyone?) .
cheers
Uli
[1] the way the names of functions or methods modified in order to be
presented to the linker.
[2] Application Binary Interface, the way arguments for function-calls are
treated before calling the function and return-values are retrieved
afterwards.
Reply to: