locked
Fatal Error c1083 RRS feed

  • Question

  • I newly installed Microsoft Visual Studio 2010 Ultimate. At that time I used to compile some programs in Command Prompt.(although I have MSVS10, I liked to test cmd.). I compiled programs using cl.exe (C:\...\Eddie>cl -EHsc program-name.cpp). It was correct and compiles were successful. But now It says about an error, "Fatal error C1083: cannot open include file 'iostream': No such file or directory". This is my source code:

    #include <iostream>

    using namespace std;

    int main() {

    cout<<"Hello World!" <<endl;

    return 0;

    }

    But this source code is running normally in the IDE. the problem in compiling of cmd.(I think). Someone help me. Thank you.

    Tuesday, July 17, 2012 7:08 AM

Answers

  • How are you opening the console window for command line
    compiling? The environment variables must be set for
    the tools to be able to find the files they need. This
    will be done automatically if you open the console
    window using the IDE menu:

    Tools->Visual Studio 2010 Command Prompt

    Or open it via the Start->All Program->Visual Studio ... Tools
    menus.

    - Wayne
    • Marked as answer by Helen Zhao Tuesday, July 24, 2012 1:35 AM
    Tuesday, July 17, 2012 7:41 AM

All replies

  • How are you opening the console window for command line
    compiling? The environment variables must be set for
    the tools to be able to find the files they need. This
    will be done automatically if you open the console
    window using the IDE menu:

    Tools->Visual Studio 2010 Command Prompt

    Or open it via the Start->All Program->Visual Studio ... Tools
    menus.

    - Wayne
    • Marked as answer by Helen Zhao Tuesday, July 24, 2012 1:35 AM
    Tuesday, July 17, 2012 7:41 AM
  • As WayneAKing explained, you can see multiple native version OS (X86, X64, Itanium, etc). It internally calls the following bat file alogn with different params  

    ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" amd64


    Thanks and Regards Selvam http://www15.brinkster.com/selvamselvam/

    • Proposed as answer by Helen Zhao Tuesday, July 24, 2012 1:35 AM
    Tuesday, July 17, 2012 2:06 PM