Cannot open include file 'afxres.h' in VC2010 Express

后端 未结 8 1814
庸人自扰
庸人自扰 2021-01-30 02:01

I\'m trying to compile an old project using VS express 2010 but I get this error:

fatal error RC1015: cannot open include file \'afxres.h\'. from this cod

相关标签:
8条回答
  • 2021-01-30 02:24

    Had similar issue but the message was shown when I tried to open a project solution. What worked for me was:

    TOOLS -> Import and Export Settings...-> Reset all settings

    0 讨论(0)
  • 2021-01-30 02:25

    This header is a part of the MFC Library. VS Express edition doesn't contain MFC. If your project doesn't use MFC you can safely replace afxres.h with windows.h in your terrain2.rc.

    0 讨论(0)
  • 2021-01-30 02:28

    You can also try replace afxres.h with WinResrc.h

    0 讨论(0)
  • a similar issue is for Visual studio 2015 RC. Sometimes it loses the ability to open RC: you double click but editor do not one menus and dialogs.

    Right click on the file *.rc, it will open:

    enter image description here

    And change as following:

    enter image description here

    0 讨论(0)
  • 2021-01-30 02:35

    Had the same problem . Fixed it by installing Microsoft Foundation Classes for C++.

    1. Start
    2. Change or remove program (type)
    3. Microsoft Visual Studio
    4. Modify
    5. Select 'Microsoft Foundation Classes for C++'
    6. Update

    enter image description here

    0 讨论(0)
  • 2021-01-30 02:38

    Even I too faced similar issue,

    fatal error RC1015: cannot open include file 'afxres.h'. from this code

    Replacing afxres.h with Winresrc.h and declaring IDC_STATIC as -1 worked for me. (Using visual studio Premium 2012)

    //#include "afxres.h"
    #include "WinResrc.h"
    #define IDC_STATIC  -1
    
    0 讨论(0)
提交回复
热议问题