So I recently picked up a copy of "Sams Teach Yourself C++" and when I tried to compile the program, I got an error message. I followed the instuctions exactly, and even tried copy and pasting the code provided on their website into Code::Blocks 10.05. When I run the cmd "g++ Motto.cpp" it just gives me: ScriptConsole line = (1) column = (9) : error end of statement expected (; or lf)
Could you guys tell me what I did wrong, or if I really am missing a semicolen somewhere?
Editor: notepad++ (latest version)
Compiler/builder: Code::Blocks 10.05 (provided with the book)
1 2 3 4 5 6 7
#include <iostream>
int main()
{
std::cout << "solidum petit in profundis!\n";
return 0;
}
That error is not a compiler error. If I had to guess, that's an error originating from the script console from within C::B (which by the way is not a compiler). The instructions from this book sound odd. If they're having you use C::B, just write the code in the code editor portion of C::B and click on 'Run', which will build (if needed) and then run the program that you just wrote.
Code::blocks is an ide. It has both an editor and a compiler. Version 10.05 is also very outdated. You should go to code::blocks website and download a newer version. http://www.codeblocks.org/