FAQ: Compile & Execute - Compile and Execute

I had this same issue. Simply rerunning g++ hello.cpp seemed to fix it, although I do not know why the issue occurred in the first place

if that’s the case, why does it ask us to follow g++ up with hello.cpp? Wouldn’t it still be logical to put it like:
g++ hello.cpp on the terminal?

the Q1 is done, for the Q2 to execute it by typing= ++hello.cpp./a.out =next to the $ on the most right (yes, on the page). It should have appear= bash: ++hello.cpp./a.out: No such file or directory

a.out is the default name for a file output by a compiler if no filename is specified.

It’d be nice if the lesson told us this information, as well as why we’re typing g++ (which is because that’s compiler-specific).

Codecademy tends to have you just do things first and then explain why you did them later, which-- for me anyway-- can make for a frustrating experience.

1 Like

Instead of using “g++ a.out”, which gave an error… I used “c++ a.out” and it worked. Just FYI.

I got that exact error message, and I found that I was able to compile the command after resetting the workspace.