1. 报些系统头文件的错 winnt.h winbase.h
错误 151 error C2146: 语法错误 : 缺少“;”(在标识符“ContextRecord”的前面)
错误 152 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认
错误 153 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认
错误 154 error C2065: “PCONTEXT”: 未声明的标识符
错误 155 error C2146: 语法错误 : 缺少“)”(在标识符“ContextRecord”的前面)
错误 157 error C2182: “RtlCaptureContext”: 非法使用“void”类型
错误 158 error C2491: “RtlCaptureContext”: 不允许 dllimport 数据 的定义
.......
共 25 个错.
原因是 没有在 属性设置 - c/c++ -预处理定义器里面添加 X86, 编译英
#define X86 //表示 32位
2. LIBCMT.lib 与 msvcrt.lib 冲突了
错误 151 error LNK2005: "private: __thiscall type_info::type_info(class type_info
const &)" (??0type_info@@AAE@ABV0@@Z) 已经在 LIBCMT.lib(typinfo.obj) 中定义
msvcrt.lib
错误 152 error LNK2005: "private: class type_info & __thiscall
type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) 已经在
LIBCMT.lib(typinfo.obj) 中定义 msvcrt.lib
解决办法:
在属性设置 - 链接器 - 输入 - 忽略特定库 LIBCMT.lib
注意 Debug 版的 忽略 LIBCMTD.lib, Release 版的忽略 LIBCMT.lib