stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

Created in VS6

Tried to compile in VS2005 Express and got the above error.

Installed the latest Platform SDK which contains afxwin.h, but get the same error.

Here is the code:

// stdafx.h : include file for standard system include files,

// or project specific include files that are used frequently, but

// are changed infrequently

//

#if !defined(AFX_STDAFX_H__38F261C7_B9D0_11D1_94AA_444553540000__INCLUDED_)

#define AFX_STDAFX_H__38F261C7_B9D0_11D1_94AA_444553540000__INCLUDED_

#if _MSC_VER >= 1000

#pragma once

#endif // _MSC_VER >= 1000

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

#include <afxwin.h> // MFC core and standard components

#include <afxext.h> // MFC extensions

#ifndef _AFX_NO_AFXCMN_SUPPORT

#include <afxcmn.h> // MFC support for Windows Common Controls

#endif // _AFX_NO_AFXCMN_SUPPORT

 

//{{AFX_INSERT_LOCATION}}

// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__38F261C7_B9D0_11D1_94AA_444553540000__INCLUDED_)



Answer this question

stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

  • ejohnson0547

     Jonathan Caves MSFT wrote:

    One thing to note is that, contrary to what I stated above (sorry!), Visual C++ Express does not support developing for MFC and/or ATL. So this may explain why you can't find afxwin.h



    We shld still be able to find it if we do the correct linking to the microsoft platform SDK right Can you please give some insight regarding my previous post in this thread Thanks alot! :)

  • MatHertel

    I have the same problem.

    Try this:http://www.microsoft.com/downloads/details.aspx familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en

    "Using Visual C++ 2005 Express Edition with the Microsoft Platform SDK

    "By Brian Johnson,
    Microsoft Corporation

    "You can use Visual C++ Express to build powerful .NET Framework applications immediately after installation. In order to use Visual C++ Express to build Win32 applications, you'll need to take just a few more steps. I'll list the steps necessary for building Win32 applications using Visual C++ Express.Visual C++ 2005 Express Edition with the Microsoft Platform SDK"

    Im not sure if it will work. I would try it but the file is to big for me to download.


  • Hawkeman

    What are your project settings Specifcally what is INCLUDE set to Does it include the location of the ATL headers With a default install of Visual Studio 2005 they should be located at:

    C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include


  • YuSian

    I don't mean to intrude, but I noticed following the link provided did not take me to the correct location. However, I was able to find it at

    http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

    At least, this article has the exact same title and author.

    Thanks

  • skumarpraveen

    This thread describes how to update the directories in the Visual C++ Express Beta

    http://forums.microsoft.com/msdn/ShowPost.aspx PostID=2995

  • Ferinos

    Hi Nikola, the default include path is:

    Include="$(VCInstallDir)include;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"

    Can you show us the EXACT modified path

    e.g.

    Include="$(ProgramFiles)include;xxxx
    or
    Include="C:\Program Files\xxx

    Thanks in advance.


  • 3TP LLC

    No: the Platform SDK does not include MFC an ATL.

  • FrankGibbs

    I get the same error and I have net. 2005 professional edition with an MSDN subscription. I made a simple nfc dialog application and i get the fatal eeor c1083. If I created any mfc application I get that error. And if I start including reference to the include file then I get other errors that can not find other files are error complainng about crt library.
    Am I missing something

    If anyone has a solution you can email me directly at sun_Water_snow@hotmail.com
    thanks

  • dwertz

    One thing to note is that, contrary to what I stated above (sorry!), Visual C++ Express does not support developing for MFC and/or ATL. So this may explain why you can't find afxwin.h



  • Dstroyer

    I found same error as follows;

    ------ Rebuild All started: Project: MkRich, Configuration: Debug Win32 ------
    Deleting intermediate and output files for project 'MkRich', configuration 'Debug|Win32'
    Compiling...
    stdafx.cpp
    c:\mkrich\mkrich\stdafx.h(21) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
    Build log was saved at "file://c:\MkRich\MkRich\Debug\BuildLog.htm"
    MkRich - 1 error(s), 0 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

     

    // stdafx.h : include file for standard system include files,

    // or project specific include files that are used frequently, but

    // are changed infrequently

    //

    #if !defined(AFX_STDAFX_H__38F261C7_B9D0_11D1_94AA_444553540000__INCLUDED_)

    #define AFX_STDAFX_H__38F261C7_B9D0_11D1_94AA_444553540000__INCLUDED_

    #if _MSC_VER >= 1000

    #pragma once

    #endif // _MSC_VER >= 1000

    #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

    #include <afxwin.h> // MFC core and standard components

    #include <afxext.h> // MFC extensions

    #ifndef _AFX_NO_AFXCMN_SUPPORT

    #include <afxcmn.h> // MFC support for Windows Common Controls

    #include <afxdisp.h>        // MFC class

    #include <afxdtctl.h>  // Internet Explorer 4 

    #endif // _AFX_NO_AFXCMN_SUPPORT

     

    //{{AFX_INSERT_LOCATION}}

    // Microsoft Developer Studio will insert additional declarations immediately before the previous line.

    #endif // !defined(AFX_STDAFX_H__38F261C7_B9D0_11D1_94AA_444553540000__INCLUDED_)



  • blitzy

    I get this error as well. Shame that as a learning tool it should be loud and clear what it can and can't do. If it's not allowed, how about a "You can't do that with ths tool" instead of some cryptic message you have to spend hours figuring out.

    To me, this is disappointing as an evaluation tool. Coming over from another world I thought what better way to evaluate the tool than to download some code and try it out - alas, I can't do that becuase I guess the code I'm using can't be compiled. What I wantd to do is try out the code, change a couple of things and see what I get.

    I have no problem paying but I want to see the tool is easy to use, helps me day to day, and doesn't hinder me to earn my company some dollars. Looks like I'm going to have to invest serious time as well as the dollars - just to figure out if this will be good for my company

    Too bad, I thought this was going to be a good thing....

    ....I would think that if MFC and ATL were more past experiences for developers that evaluation support would be a natural. Ya know, kind of a "learn from the past but look at what you get in the future". Instead I get an evalation tool that is - look, you got to learn it to use it no learning from the past is allowed. Sorry, not going to help me.

    Too bad, I was excited to think that MS tools had finally 'got it'. Mmmmm, guess I'll go use my other tool .......



  • Art W

    Ermmm... but i thought the additional microsoft platform SDK that we can download has mfc and atl I mean i can find afxwin.h in my microsoft platform SDK folder under "C:\Program Files\Microsoft Platform SDK\Include\mfc", its just that i have no idea how to modify the VCProjectEngine.Dll.Express.dll file to link it.
  • Jonas H&amp;#228;lldal

    Starting with VC 2005, you can no longer develop for MFC and ATL for free.  You have to purchase a paid version of VC 2005 (i.e. Standard or better) to develop for MFC and ATL.

    The files you see in the Platform SDK related to MFC are only for 64 bit development.  32 Bit development of MFC only comes with paid versions of VC 2005.

    Ted.

  • KennyLee

    You need to add "C:\Program Files\Microsoft Platform SDK\Include\mfc\" to your INCLUDE path. The libraries are in "C:\Program Files\Microsoft Platform SDK\lib\". FYI, this is also version of MFC/ATL/CRT based on VC6.

    Thanks,
    Nikola
    VC++

  • stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory