some issues fix on building menu resource file.
#include afxres.h or #include windows.h can fix this issue in resource file definition.
- error RC2104: undefined keyword or key name: DS_SETFONT
- http://www.winprog.org/tutorial/errors.html
- Error LNK2001: unresolved external symbol _main
- Error C2440: cannot convert from 'void*' to 'HICON__ *' (or similar)
- Fatal error RC1015: cannot open include file 'afxres.h'
- Error LNK2001: unresolved external symbol InitCommonControls
- Dialog does not display when certain controls are added
- Resource Compiler Error RC2104
- error RC2104 : undefined keyword or key name: ID_FILE_MRU_FILE1 in my .rc file
- Thread: error RC2104 : undefined keyword or key name
- Ошбика undefined keyword or key name: WS
- fatal error RC1015: cannot open include file 'afxres.h'
- VS 2017 .RC file - Error RC1015 cannot open include file 'afxres.h'
- Cannot open include file 'afxres.h' in VC2010 Express
the answer is:
Or, if you don't want to install MFC, you can replace the line:
#include "afxres.h"
with:
#include
In the newest version of Visual Studio 2017 this seems to have been separated into two components that needs to be installed. 1)Visual C++ ATL for x86 and x64 2)Visual C++ MFC for x86 and x64
Tools -> Get Tools and Features... will list what components are installed and allow for adding and removing of components.
answerThis 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.
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
Alternatively you can create your own afxres.h:
#ifndef _AFXRES_H
#define _AFXRES_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _WINDOWS_H
#include
No comments:
Post a Comment