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

Viewed 132352

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 code

/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

I have installed Windows SDK already, but without any success.

thanks!

9 Answers

I faced same issue on VS 2019. My solution was to install C++ MFC library from Individual Components tab. When you open Visual Studio go to Tools->GetToolsAndFeatures->IndividualComponents

Select and install:

  • MSVC v142 - VS 2019 C++ x64/x86 build tools (Latest)
  • C++ ATL for latest v142 build tools (x86 & x64)
  • C++ MFC for latest v142 build tools (x86 & x64)
Related