New to programming need some help!

Started by
10 comments, last by owiley 14 years, 2 months ago
Awhile back I decided to take my hand at programming. So as I am sure quite alot of you have seen this so please bare with me. I got A Beginners Guide to C++. /* This is a simple C++ program. Call this file Sample.cpp. */ #include <iostream> using namespace std; // A C++ program begins at main(). int main() { cout << "C++ is power programming."; return 0; } I followed the code a T, but when I go to compile the the code in Microsoft Visiual Studio 2008 I get this message in Command Prompt.... "... Is not recongnized as an internal or external command, operable program or batch file" What am I doing wrong?
Advertisement
do you have the full error message?
http://stowelly.co.uk/
C:\Users\Nate\Documents\Visuial Studio 2008\Projects\Sample1.cpp>cl -GX Sample1.cpp


C\Users\Nate\Visiual is not recongnized as an internal or external command, operable program or batch file"

I hope that helps :)
try it whit "Visual" in stead of "Visuial"

or did you change it your self to this
or is this some curious language version ?
Oh wow sorry I mistyped. No I spelled it visual when I was entering it into command prompt so it is correct, sorry about that typo.
Quote:C:\Users\Nate\Documents\Visuial Studio 2008\Projects\Sample1.cpp>cl -GX Sample1.cpp


I'm not sure I'm following here. Are you typing the above paragraph into the command window manually? The error message you receive kind of hints towards that anyway. It basically tells you that there is no executable file called "Visuial" located at C:\Users\Nate\Documents\. Which is exactly what you would get if you typed the above paragraph in a "DOS"-window and hit enter, due to the lack of " " around the path which is space-split.

But why you are doing so is beyond me, try hitting F7 in visual studio instead to compile :)

If you are compiling through visual studio by the usual means and still get this error, then I'm afraid your installation of Visual Studio is rather messed up and in desperate need of a reinstall. There is nothing wrong with your code, it's just the compiler that fails to execute.
Hello,

i am not so sure what you are doing exactly, but if you are typing into cmd.exe try this:

Execute vcvars32.bat in C:\Programme\Microsoft Visual Studio 8\VC\bin
use same cmd window to compile.

if this fails, try looking here.

http://msdn.microsoft.com/en-us/library/ms235639%28VS.80%29.aspx


GWDev
When you see something in a book like:

C:\Users\Nate\Documents\Visual Studio 2008\Projects\Sample1.cpp>cl -GX Sample1.cpp


The first part up until the '>' is the command prompt. You do not type it as part of your command. Instead, it shows you what directory you should be in, in order to use the command.

It's wrong, anyway, because the file name is not part of the directory path. I assume you have a project named 'Sample1', so that would be part of the directory path.

Here are step-by-step instructions:

1) Open a command window. You should see something like C:\Users\Nate>_, with the underscore blinking.

2) Type cd "Documents\Visual Studio 2008\Projects\Sample1", with the quotes, and hit enter.

3) The next line should now look like C:\Users\Nate\Documents\Visual Studio 2008\Projects\Sample1>_.

4) Type cl -GX Sample1.cpp and hit enter.
Hey guys thank you I finally got it to work, and panic bud I don't know what I am trying to do. I have been an artist and a modeler for so long I thought I would take my hand at the foundation of game design instead of the artistic side.
Hey, good for you for jumping into programming like this! i just did a mentoring project with a middle school student last year, so I know how hard it can be to jump into game dev
- TomasTea Time with Meowkins: http://blogs.windwardreports.com/tomasr/

This topic is closed to new replies.

Advertisement