Anfäger mit tut Problemen!
-
Also ich versuche mit dem Volkards C++ Kurs mir so nen bissel die grundlagen anzueigenen!
Nutze den DEV C++ Bloodsheed Compiler!
Nur schon bei dem ersten Programm das man schreiben soll, werden Fehler beim Copiler augegeben!
Da ich keine ahnung hab wodran das liegt... wollte ich nicht so "Fehlerhaft" weitermachen... also hier der TExt der cpp datei:
#include <iostream.h> void main() { // Dies ist das Hello-World-Programm cout<<"Hello, world!"<<endl; };keine ahnung ob da schon ein fehler drinn ist...aber das sagt der compiler:
// Copyright (C) 2001 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 2, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, // USA. // As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. #ifndef _BACKWARD_BACKWARD_WARNING_H #define _BACKWARD_BACKWARD_WARNING_H 1 #ifdef __DEPRECATED #warning This file includes at least one deprecated or antiquated header. \ Please consider using one of the 32 headers found in section 17.4.1.2 of the \ C++ standard. Examples include substituting the <X> header for the <X.h> \ header for C++ includes, or <iostream> instead of the deprecated header \ <iostream.h>. To disable this warning use -Wno-deprecated. #endif #endifIch weiß nur nicht was ich machen kann oder warum das Programm nicht das tut richtig Completieren kann...
Ich hoffe nicht das was da drinn steht waflsch ist o.O. wenn ja dann sagt mir bitte ein anderes einfaches tut oder eiin PRogramm was die Quellcode copletieren kann.
Danke!
ps: win Xp Professional mit neusten updates user, fals von intresse ist...
mfg Mother-Brain
-
#warning This file includes at least one deprecated or antiquated header. \
Please consider using one of the 32 headers found in section 17.4.1.2 of the \
C++ standard. Examples include substituting the <X> header for the <X.h> \
header for C++ includes, or <iostream> instead of the deprecated header \
<iostream.h>. To disable this warning use -Wno-deprecated.
-
Mother-Brain schrieb:
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.#ifndef _BACKWARD_BACKWARD_WARNING_H
#define _BACKWARD_BACKWARD_WARNING_H 1#ifdef __DEPRECATED
#warning This file includes at least one deprecated or antiquated header. \
Please consider using one of the 32 headers found in section 17.4.1.2 of the \
C++ standard. Examples include substituting the <X> header for the <X.h> \
header for C++ includes, or <iostream> instead of the deprecated header \
<iostream.h>. To disable this warning use -Wno-deprecated.
#endif#endif
Da steht doch der Fehler. Nicht iostream.h, sondern ohne .h
Und dann schreibst du unter das #include noch 'using namespace std;'
-
danke dann schon mal... aber warum geht das denn so? ist das tut schlecht? oder der compilier? also ich blick das ja noch überhabt nicht..
-
Mother-Brain0 schrieb:
ist das tut schlecht?
Es ist, zumindest in der Beziehung, eben nicht auf dem neuesten Stand.
-
DarthZiu schrieb:
Und dann schreibst du unter das #include noch 'using namespace std;'
Besser ohne using namespace...
-
David_pb schrieb:
Besser ohne using namespace...
Dann sag ihm aber bitte auch, dass er dann std::cout und std::endl schreiben muss ...

Sonst steht er gleich vor dem nächsten unlösbaren Problem. Übrigens denke ich, dass es für einen Anfänger wesentlich leichter (und übersichtlicher) ist, wenn er 'using namespace std' nimmt. Wenn er dann natürlich (zirka in einer Woche) ne API mit 25 Klassen und 5.000 Zeilen Code schreibt und damit in Namespace-Konflikte gerät, kann er es dann gerne so machen, wie du es ihm vorschlägst.
-
Mother-Brain schrieb:
Also ich versuche mit dem Volkards C++ Kurs mir so nen bissel die grundlagen anzueigenen!...
An und für sich keine schlechte Idee, aber wenn Du schon bei C++ bist, fällt mir spontan noch eine andere Sprache ein, die sich für Dich zu lernen lohnte.

Gruß,
Simon2.
-
DarthZiu schrieb:
David_pb schrieb:
Besser ohne using namespace...
Dann sag ihm aber bitte auch, dass er dann std::cout und std::endl schreiben muss ...

Sonst steht er gleich vor dem nächsten unlösbaren Problem. Übrigens denke ich, dass es für einen Anfänger wesentlich leichter (und übersichtlicher) ist, wenn er 'using namespace std' nimmt. Wenn er dann natürlich (zirka in einer Woche) ne API mit 25 Klassen und 5.000 Zeilen Code schreibt und damit in Namespace-Konflikte gerät, kann er es dann gerne so machen, wie du es ihm vorschlägst.
Was spricht dagegen sich garnich erst an using namespace zu gewöhnen?
Sonst steht er (in zirka einer Woche) wieder hier, mit einem unlösbaren Problem... 
grüße
-
Volkard hat seinen Kurs bis zu ner gewissen lektion aktualisiert, siehe www.volkard.de
Nimm mal die neue Version soweit es geht durch, das vermeidet diese Fehler. Es soll z.B auch int main und nicht void main sein, manche compiler geben da auch ne Fehlermeldung oder ne Warnung.