Fehlermeldung



  • Ich habe ein Hello-World Programm aus einem Kurs abgeschrieben und bekomme folgende Fehlermeldung:

    1 C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31, from C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp

    1 C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp from C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp

    32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #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.

    3 C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp `main' must return `int'

    bei folgendem Programm:

    #include <iostream.h>
    void main()
    {
       // Dies ist das Hello-World-Programm
       cout<<"Hello, world!"<<endl;
    };
    

    Kann jemand helfen?



  • http://www.c-plusplus.net/forum/viewtopic-var-t-is-151578.html

    Punkt 3 beachten!

    Schmeiss das Tutorial weg! Wird wahrscheinlich noch mehr Fehler drin haben.



  • Steht doch schon da was du machen sollst.

    Montekar schrieb:

    32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #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.

    3 C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp main' must **returnint**'



  • Ich hab mir gestern das Tutorial geladen und hab kenn mich überhaupt nicht mit c++ aus sry... wo find ich denn ein besseres Tutorial für Einsteiger?



  • #include <iostream>
    int main()
    {
       // Dies ist das Hello-World-Programm
       cout<<"Hello, world!"<<endl;
      return 0;
    };
    


  • Klappt alles nicht: Neues Tutorial, gleicher Fehler...



  • #include <iostream> 
    int main() 
    { 
       // Dies ist das Hello-World-Programm 
       std::cout<<"Hello, world!"<<std::endl; 
      return 0; 
    };
    

    Wenn das nun immernoch nicht klappt, noch mal Fehlermeldungen posten



  • Also, ich habe einen Compiler und ein Tutorial runtergeladen, brauche ich vielleicht sonst noch was?

    (Fehlermeldung hat sich nicht geändert...)



  • Das ist überhaupt nicht möglich.

    Wenn du diesen Quelltext:

    #include <iostream>
    int main()
    {
       // Dies ist das Hello-World-Programm
       std::cout<<"Hello, world!"<<std::endl;
      return 0;
    };
    

    durch einen Compiler jagst, können diese Fehlermeldungen

    32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #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.

    3 C:\Dokumente und Einstellungen\Benutzer\Desktop\main.cpp `main' must return `int'

    unmöglich auftauchen.



  • Hallo

    das Tutorial hier ist aktuell und korrekt

    bis bald
    akari



  • Hallo
    ich habe schon mal erlebt das es am Compiler liegt, "int main()" hat nicht gereicht, mit "int main(int argc, char *argv[])" gings dann.

    Grüße, Mathes


Anmelden zum Antworten