我不能在本机子系统中使用异常处理。
这是我的 cpp 文件:
#include <ntddk.h>
#include <exception>
int __cdecl main () {
try
{
throw 20;
}
catch (int e)
{
}
return 0;
}
还有我的源文件:
TARGETNAME = native
TARGETTYPE = PROGRAM
UMTYPE = nt
USER_C_FLAGS=$(USER_C_FLAGS) /EHa
SOURCES = exeption.cpp \
INCLUDES=$(DDK_INC_PATH)
MINWIN_SDK_LIB_PATH=$(SDK_LIB_PATH)
TARGETLIBS=$(NTDLL_CRT) $(SDK_LIB_PATH)\ntdll.lib lib.lib
我的错误是:
error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$_main
error LNK2019: unresolved external symbol __EH_epilog3 referenced in function __catch$_main$0
error LNK2019: unresolved external symbol __EH_prolog3_catch referenced in function _main
error LNK2019: unresolved external symbol __CxxThrowException@8 referenced in function _main
error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
我该如何解决这个问题?