unten ist mein Hallo Weltprogramm Ich habe in Nano-Editor geschrieben.mehrere Fehler beim kompilieren einfach Hallo Welt C++ - Programm in g ++ Ubuntu
#include<iostream>
using namespace std;
int main
{
cout<< "Hello world";
return 0;
}
wenn ich es kompiliert habe, habe ich diese vielen Fehler.
ello.cpp:4:5: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
int main
^
hello.cpp:6:22: error: expected ‘}’ before ‘;’ token
cout<< "Hello world";
^
hello.cpp:6:6: error: invalid user-defined conversion from ‘std::basic_ostream<char>’ to ‘int’ [-fpermissive]
cout<< "Hello world";
^
In file included from /usr/include/c++/4.8/ios:44:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from hello.cpp:1:
/usr/include/c++/4.8/bits/basic_ios.h:115:7: note: candidate is: std::basic_ios<_CharT, _Traits>::operator void*() const [with _CharT = char; _Traits = std::char_traits<char>] <near match>
operator void*() const
^
/usr/include/c++/4.8/bits/basic_ios.h:115:7: note: no known conversion for implicit ‘this’ parameter from ‘void*’ to ‘int’
hello.cpp:7:2: error: expected unqualified-id before ‘return’
return 0;
^
hello.cpp:8:2: error: expected declaration before ‘}’ token
}
bitte helfen Sie mir.
'int main' Sie Klammer wieder fehlt:' int main() ' – DimChtz
Sie benötigen einen [Anfänger Buch] zu finden (http: // Stackoverflow .com/fragen/388242/the-definitive-c-book-guide-und-list) zu lesen. –
C++ - Fehlermeldungen werden sorgfältig entworfen, um maximale Verwirrung für triviale Fehler zu verursachen. – molbdnilo