cla*_*amp 134 c++ winapi visual-studio visual-c++
我正在尝试使用VS express 2010编译旧项目,但是我收到此错误:
致命错误RC1015:无法打开包含文件'afxres.h'.从这段代码
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
Run Code Online (Sandbox Code Playgroud)
我已经安装了Windows SDK,但没有任何成功.
谢谢!
Kir*_*sky 189
此标头是MFC库的一部分.VS Express版不包含MFC.如果您的项目不使用MFC,您可以安全地替换afxres.h为windows.h您的terrain2.rc.
Col*_*nic 122
有同样的问题.通过安装Microsoft基础类C++来解决此问题.

rav*_*bie 36
即使我也面临类似的问题,
致命错误RC1015:无法打开包含文件'afxres.h'.从这段代码
用Winresrc.h替换afxres.h并将IDC_STATIC声明为-1对我有用.(使用visual studio Premium 2012)
//#include "afxres.h"
#include "WinResrc.h"
#define IDC_STATIC -1
Run Code Online (Sandbox Code Playgroud)
小智 11
或者你可以创建自己的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
Run Code Online (Sandbox Code Playgroud)
设法通过从另一个Visual Studio设置(非快速)复制下面的文件夹来解决这个问题
来自C:\ Program Files(x86)\ Microsoft Visual Studio 12.0\VC\atlmfc
到C:\ Program Files(x86)\ Microsoft Visual Studio 11.0\VC\atlmfc
| 归档时间: |
|
| 查看次数: |
115033 次 |
| 最近记录: |