Having problem with VS C++2008 when using command prompt to compile source code

Hi everyone, I am new here and new to C++ as well.

I just started to write my first sample program, hello world;
When I use VS 2008's IDE to compile, everything works fine.
However when I tried to use command prompt form VS 2008 by typing

cl -EHsc sample.cpp

the error C1083 kept showing up.

I tried searching but didn't find answers that matched.

Any advice will be appreciated.

Thanks just so much, guys!
You might be running it from a different directory than the IDE, causing some #includes to be in different places or something.
Well, the error is saying that some or other file is missing.

Check though the list of possible causes below.

In particular, check that the INCLUDE environment variable is correct.

Andy

http://msdn.microsoft.com/en-us/library/et4zwx34(v=VS.90).aspx

Fatal Error C1083
Visual Studio 2008
Cannot open filetype file: 'file': message

To fix by checking the following possible causes

1.File does not exist.

2.File, subdirectory, or disk is read-only.

3.No access permission for file or directory.

4.Not enough file handles. Close some applications and recompile.

5.The INCLUDE environment variable is set incorrectly.

6.An #include directive uses double quotation marks around a path specification, which causes the standard directories to be skipped.

7.You did not specify /clr and your program uses CLR constructs.

8.You attempted to compile a single file in the project without first compiling stdafx.cpp. Before you can compile a single file in the project, you need to compile stdafx.cpp. In the case of the /analyze (Enterprise Code Analysis) compiler option, you will need to use the same /analyze setting for stdafx.cpp that you use for the .cpp file.
Topic archived. No new replies allowed.