help-gplusplus
[Top][All Lists]
Advanced

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

Re: g++ 3.4.3: backwards compatibility


From: Paul Pluzhnikov
Subject: Re: g++ 3.4.3: backwards compatibility
Date: Wed, 02 Nov 2005 07:12:46 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Ulrich Windl <Ulrich.Windl@RZ.Uni-Regensburg.DE> writes:

> when trying to compile an older application that compiled for around g++ 2.8,
> I see several errors:
>
> `cerr' undeclared (formerly from <iostream.h> I think)

Add "using namespace std;" or replace 'cerr' with 'std::cerr' ...

> `std::basic_string' cannot be converted to `const char *' when used as actual
> parameter for a function call

Use string::c_str() to get the "C string representation" ...

> The macro definition
> #define foo(n) set_##n##(const char *s)
> does no longer work. The error is ` pasting "set_SAMPLE" and "(" does not give
> a valid preprocessor token

That's because one of the '##' is unnecessary. 
Try '#define foo(n) set_ ## n (const char *s)'

> Is there some "porting guide" for those who did not actively follow recent C++
> development?

I don't know of such, but would recommend "Accelerated C++" by
Andrew Koenig and Barbara E. Moo as a "quick refresh course on
modern C++". http://www.acceleratedcpp.com/

A lot of your errors appear to stem from very dated understanding
of C++.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]