win32 application

i have read abt this frm the forum and followed steps given in the following link :

http://lab.msdn.microsoft.com/express/visualc/usingpsdk/default.aspx

but still i am getting the following error:

1>c:\documents and settings\administrator\my documents\visual studio 2005\projects\test\test\stdafx.h(28) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory



i am missing something . plz help



Answer this question

win32 application

  • Hodor

    Mr Mox wrote:
    It is probably a case of not refering to the std namespace. The code should look like
    #include <iostream>

    int main()
    {
    std::cout << "Hello, world!\n";
    }
    or
    #include <iostream>
    using namespace std;

    int main()
    {
    cout << "Hello, world!\n";
    }

    This worked for me. Though novice myself and not that I can help much but which machine are you running on (x86 or something else)

    Zoran K.


  • aodeng

    when i searched for that file i can get only 2 files under following folder
    C:\Program Files\Microsoft Platform SDK\Lib\AMD64
    C:\Program Files\Microsoft Platform SDK\Lib\IA64

    i tried to add 2nd location to option->VC++ directories->include lib->

    but still i am getting this error


  • Hexxagonal

    i did as u told used
    #include<iostream>

    but now i am getting this error

    1>c:\documents and settings\administrator\my documents\visual studio 2005\projects\test\test\test.cpp(6) : error C2065: 'cout' : undeclared identifier

    it is not taking the iostream header now


  • massmax

    i did as u told

    this is my psdk location:
    C:\Program Files\Microsoft Platform SDK

    i have added to lib directories as :
    C:\Program Files\Microsoft Platform SDK R2\lib

    but there is no option like include directory but i can find exclude directory

    tried to build the win32 window application still i am getting same error



  • HemaDevi

    This is a guess but based on http://support.microsoft.com/default.aspx scid=kb;en-us;154753, I think that you may have a #include<iostream.h> in your code - try #include<iostream> instead.


  • BillBaker2000



    great it is working now thanx for help


  • SharonSalmon

    It is probably a case of not refering to the std namespace. The code should look like
    #include <iostream>

    int main()
    {
    std::cout << "Hello, world!\n";
    }
    or
    #include <iostream>
    using namespace std;

    int main()
    {
    cout << "Hello, world!\n";
    }


  • Trigun

    I get three hits - the two you mention, and also one in C:\Program Files\Microsoft Visual Studio 8\VC\lib. This last one is obviously the one you are missing. However, why it is missing, I cannot tell.


  • Kamardash86471

    At least it is now some other files it is missing... I still think that somehow your settings for VC++ lib directories are messed up. If you search C:\Program Files\ for msvcprtd.lib what is the result


  • DanAg

    i tried a simple test program when i try to compile

    i am getting
    1>msvcirtd.lib(msvcirtd.dll) : fatal error LNK1112: module machine type 'IA64' conflicts with target machine type 'X86'

    when i searched for that file i can get only 2 files under following folder
    C:\Program Files\Microsoft Platform SDK\Lib\AMD64
    C:\Program Files\Microsoft Platform SDK\Lib\IA64

    i tried to add 2nd location to option->VC++ directories->include lib->

    but still i am getting this error
    do i need to have same file under x86.







  • wangx0

    You mean there's no place you can set include directories

    Try and go to the Tools menu, then select Options.
    In the Options dialog, select Projects, then VC++ directories. In the upper right there's a drop down list labeled "Show directories for". In the drop down list, select the "Include files" item. This shows you where VC++ looks for include files.

    Do a search for windows.h in the "C:\Program Files\" directory and add the directory in which windows.h resides to the include list.




  • Amazing Andrei

    i am running the x86

    i used the same code :

    #include <iostream>

    int main()
    {
    std::cout << "Hello, world!\n";
    }

    chose project as win32 -> windows appilcation ( but chose empty)

    added .cPP file to the source as above

    but when i built i get following error.

    1>msvcprtd.lib(msvcp60d.dll) : fatal error LNK1112: module machine type 'IA64' conflicts with target machine type 'X86'





  • Crepuscular

    Looking at http://lab.msdn.microsoft.com/express/visualc/usingpsdk/default.aspx, step 3 is the problem. You should add

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

    to include directories, and

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib

    to lib directories.

    (Assuming that
    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\ is the directory where you installed PSDK)


  • freenetbox

    i tried both the way

    when i used :
    std::cout << "Hello, world!\n"

    i am getting following error:
    error C2653: 'std' : is not a class or namespace name

    then when i tried :
    using namespace std;

    i am getting following error:
    error C2871: 'std' : a namespace with this name does not exist


  • win32 application