Chuyu-Team / YY-Thunks

Fix DecodePointer, EncodePointer,RegDeleteKeyEx etc. APIs not found in Windows XP RTM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YY_Thunks_for_Win2K.obj 链接错误,error LNK2001: 无法解析的外部符号 ___YY_Thunks_Process_Terminating

chenchanghong12 opened this issue · comments

问题简介:
我最近在开发一个需要兼容windows 2000的程序,在使用最新的代码编译出 YY_Thunks_for_Win2K.obj,然后链接它时会出现链接错误 error LNK2001: 无法解析的外部符号 ___YY_Thunks_Process_Terminating。
分析:
我这边看了一下源代码,看到该变量被定义在了pch.cpp中,而通过build.cmd进行构建时不会编译pch.cpp,故导致YY_Thunks.h里声明的__YY_Thunks_Process_Terminating 没有定义。

我这边试着去掉了 pch.cpp 里面的 __YY_Thunks_Process_Terminating 的定义,然后在YY_Thunks.cpp 第 124行 加上了

#if (YY_Thunks_Support_Version < NTDDI_WINXP)
EXTERN_C BOOL __YY_Thunks_Process_Terminating = 0;
#endif

解决了该问题

设计如此,这是一个weak符号,build.cmd中会调用LibMaker.exe制作weak符号,但是你本地没有……