Ich bin totaler Noob und bekomme ein "Hello World" programm nicht zum laufen.
Hier das Programm:
Code:
#include <iostream>
void main()
{
// Dies ist das Hello-world-Programm
cout<<"Hello, world!"<<endl;
};
Das will ich mit
Code:
g++ test.cc -o test
kompilieren.
Beim kompilieren kommen diese Meldungen:
Code:
test.cc:2: error: `main' must return `int'
test.cc: In function `int main(...)':
test.cc:4: error: `cout' undeclared (first use this function)
test.cc:4: error: (Each undeclared identifier is reported only once for each function it appears in.)
test.cc:4: error: `endl' undeclared (first use this function)
Warum kompiliert der das nicht?
Danke im vorraus.
Lesezeichen