Programing

VC2010 Express에서 포함 파일 'afxres.h'를 열 수 없습니다

lottogame 2020. 6. 27. 11:01
반응형

VC2010 Express에서 포함 파일 'afxres.h'를 열 수 없습니다


VS Express 2010을 사용하여 오래된 프로젝트를 컴파일하려고 하는데이 오류가 발생합니다.

치명적인 오류 RC1015 : 포함 파일 'afxres.h'를 열 수 없습니다. 이 코드에서

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

Windows SDK를 이미 설치했지만 성공하지 못했습니다.

감사!


이 헤더는 MFC 라이브러리의 일부입니다. VS Express 에디션에는 MFC가 포함되어 있지 않습니다. 프로젝트는 MFC를 사용하지 않는 경우 안전하게 대체 할 수 afxres.hwindows.h귀하의에서 terrain2.rc.


같은 문제가 있었다. C ++ 용 Microsoft Foundation Classes를 설치하여 수정했습니다.

  1. 스타트
  2. 프로그램 변경 또는 제거 (유형)
  3. Microsoft Visual Studio
  4. 수정
  5. 'C ++ 용 Microsoft Foundation Classes'를 선택하십시오.
  6. 최신 정보

여기에 이미지 설명을 입력하십시오


나도 비슷한 문제에 직면했다.

치명적인 오류 RC1015 : 포함 파일 'afxres.h'를 열 수 없습니다. 이 코드에서

afxres.h를 Winresrc.h로 바꾸고 IDC_STATIC을 -1로 선언하면 나를 위해 일했습니다. (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 <windows.h>
#endif

/* IDC_STATIC is documented in winuser.h, but not defined. */
#ifndef IDC_STATIC
#define IDC_STATIC (-1)
#endif

#ifdef __cplusplus
}
#endif
#endif   

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


managed to fix this by copying the below folder from another Visual Studio setup (non-express)

from C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc

to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc


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:

여기에 이미지 설명을 입력하십시오

And change as following:

여기에 이미지 설명을 입력하십시오


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

참고URL : https://stackoverflow.com/questions/3566018/cannot-open-include-file-afxres-h-in-vc2010-express

반응형