Creating a Program

Hi all, very very basic problem/question here. Quick background, I am working through Sams Teach Yourself C++ and am at the very beginning, "Creating Your First Program". Using Notepad++ I wrote a source code (I even copied and pasted it from online, so I know the code isn't the problem) and saved it as Motto.cpp. But, when I enter the command to compile the file and link it, I get the following message..

C:\>g++ Motto.cpp -o Motto.exe
g++: error: Motto.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated

...I'm assuming I'm doing something wrong when I save it, but for the life of me I have no idea. Any thoughts? I've tried saving it as an H File and then using Motto.h in the command and I'm getting the same message
What directory did you save the file to?

When you run g++, you're in the root directory. That's where g++ will look for moto.cpp

Its under Program Files (x86) ... I figured that might have been my mistake but I already tried opening that folder and running g++ there...

C:\ >CD Program Files (x86)

C:\Program Files (x86)>g++ Motto.cpp -o Motto.exe
g++: error: Motto.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated
scratch that, its under Notepad++ which is in the Program Files (x86) folder .. I think I just need to be more specific ... sorry, brand spanking new at all of this!
Got it!
Topic archived. No new replies allowed.