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

clamp picture clamp · Aug 25, 2010 · Viewed 120.6k times · Source

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!

Answer

Kirill V. Lyadvinsky picture Kirill V. Lyadvinsky · Aug 25, 2010

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.