From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26280 invoked by alias); 25 Nov 2004 17:37:04 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26108 invoked from network); 25 Nov 2004 17:36:57 -0000 Received: from unknown (HELO mail.uni-magdeburg.de) (141.44.1.10) by sourceware.org with SMTP; 25 Nov 2004 17:36:57 -0000 Received: from cserv5.urz.uni-magdeburg.de ([141.44.1.5]) by mail.uni-magdeburg.de with esmtp (EXIM Version 4.43) for id 1CXNY8-0002M5-Tb; Thu, 25 Nov 2004 18:36:57 +0100 Received: from mail.uni-magdeburg.de (mail.uni-magdeburg.de [141.44.1.10]) by cserv5.urz.uni-magdeburg.de (8.12.11/8.12.11) with ESMTP id iAPHZu8S006801 for ; Thu, 25 Nov 2004 18:35:57 +0100 (MET) (envelope-from Claudio.Bley@Student.Uni-Magdeburg.DE) Received: from sunny.urz.uni-magdeburg.de ([141.44.8.7]) by mail.uni-magdeburg.de with esmtp (EXIM Version 4.43) for id 1CXNY4-0002Ld-Nm; Thu, 25 Nov 2004 18:36:52 +0100 Received: from connect5.urz.uni-magdeburg.de (connect5.URZ.Uni-Magdeburg.DE [141.44.11.6]) by sunny.urz.uni-magdeburg.de (8.12.10/8.12.10) with ESMTP id iAPHakYS014036 for ; Thu, 25 Nov 2004 18:36:46 +0100 Received: (from bley@localhost) by connect5.urz.uni-magdeburg.de (8.11.6/8.11.6) id iAPHaih08992 for gcc-help@gcc.gnu.org; Thu, 25 Nov 2004 18:36:44 +0100 Date: Thu, 25 Nov 2004 17:37:00 -0000 From: Claudio Bley To: gcc-help@gcc.gnu.org Subject: Re: Fwd: help for g++, please Message-ID: <20041125173643.GA4803@connect5.urz.uni-magdeburg.de> Mail-Followup-To: Claudio Bley , gcc-help@gcc.gnu.org References: <200411251742.16726.greil@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411251742.16726.greil@muc.de> User-Agent: Mutt/1.4.2.1i X-Scan-Signature: afbb1a741acf7196b2652c84c58dece0 X-PMX-Version: 4.7.0.111621, Antispam-Engine: 2.0.2.0, Antispam-Data: 2004.11.24.47 (Uni-Magdeburg.DE) X-PMX-Spam: Gauge=IIIIIII, Probability=7% X-PMX-Spam-Report: Report=No antispam rules were triggered by this message X-PMX-Spam-Level: IIIIIII X-PMX-Spam-Status: NO X-SW-Source: 2004-11/txt/msg00180.txt.bz2 On Thu, Nov 25, 2004 at 05:42:16PM +0100, Anton Greil wrote: > > > ---------- Weitergeleitete Nachricht ---------- > > Subject: help for g++, please > Date: Donnerstag, 25. November 2004 17:22 > From: Anton Greil > To: gcc-help@gcc.gnu.org > > Could you give me please some advices how to update my *C and *h files > of my C++ programs? > > I coded and run these programs on base of the GNU g++ compiler > of SuSE Linux 8.0 which I installed just 3 years ago. > Now I installed SuSE Linux 9.1 where the command "g++ -v" gives: > ".... gcc version 3.3.3 (SuSE Linux)". > > Invoking the new g++ on my old programs (which worked well under the old > g++ version) creates many and many error messages in connection > with header files. > > Is there an information which concerns the changings in header files > (and perhaps some other new conventions) since 2001 which I should > apply that I can run my programs again? > > What about the actual C++ ISO standard and its realization by g++ ? > What about please further developments in C++ ? Is there a web-site for > this question? > Where can I download please a corresponding C++ manual ? > > Please excuse my questions from a today tired web-searching person > who would like in the moment to write a letter to a human person! > > Thank you very much for your patience! > > Anton Greil > > ------------------------------------------------------- Hi, these type of questions seem to turn up over and over again. Well, here is an extract of a FAQ I plan to write/put online sometimes which might answer a few of your questions. (any suggestions, changes, corrections to this article more than welcome, of course) Why can't gcc/g++ compile this quite simple C++ program? Most likely, your program is not compliant with the new C++ standard (ANSI/ISO ...), i.e. it is not correct C++. Here are a few things to check: 1) Make sure that your main function's return type is `int'. (void is not valid!) 2) Include all the necessary standard headers you're using. Note, that the standard headers don't have an extension--e.g. use `iostream' instead of `iostream.h'. 3) Utilize the `std' namespace. The STL (Standard Template Library) has its own namespace called `std'. In order to use an element of the STL you could a) explicitely specify the namespace: std::cout << "foo"; b) introduce selected members into the current namespace: use std::cout; cout << "foo"; c) include the whole std namespace: using namespace std; cout << "foo"; Here is a complete, standard compliant (as of $today) "hello world" C++ program: #include <iostream> int main() { using std::endl; std::cout << "hello, world!" << endl; } But, as you didn't go into any detail and haven't provided any code, warning / error messages from GCC you're on your own. If you have a problem you can't solve yourself try to be more specific and elaborate a little on your problem. If possible/feasable provide small complete example code which exhibits the problem. > What about the actual C++ ISO standard and its realization by g++ ? > What about please further developments in C++ ? Is there a web-site for > this question? > Where can I download please a corresponding C++ manual ? The GCC team works very hard to totally adhere to the C++ ANSI/ISO standard. The corresponding manual would be the most recent amendment of ISO 14882. For further developments of C++ you could probably have a look at http://www.open-std.org. HTH -- Claudio