c++ - g++ error: invalid preprocessing directive #INCLUDE -
i tried testing mingw under windows 7 simple hello world program , got following errors:
c:\code\helloworld.cpp:2:2: error: invalid preprocessing directive #include c:\code\helloworld.cpp:3:7: error: expected neested-name-specifier before 'namespace' c:\code\helloworld.cpp:3:17: error: expected ';' before 'std' c:\code\helloworld.cpp:3:17: error: 'std' not name type c:\code\helloworld.cpp: in function 'int main()': c:\code\helloworld.cpp:7:2: error: 'cout' not declared in scope
my original code follows:
//hello, world #include <iostream> using namesapce std; int main() { cout << "hello, world!"; return 0; }
it should lowercase. use #include
.
also, it's using namespace std;
(typo in namespace
).
Comments
Post a Comment