gpt4 book ai didi

linker - 基于 ATL 的链接器错误

转载 作者:行者123 更新时间:2023-12-04 17:38:18 24 4
gpt4 key购买 nike

我最近遇到了 atls.lib 的链接问题。我更新了链接器的附加依赖项行:

comctl32.lib
C:\WinDDK\7600.16385.1\lib\ATL\i386\atls.lib
C:\WinDDK\7600.16385.1\lib\ATL\i386\atl.lib
C:\WinDDK\7600.16385.1\lib\ATL\i386\atlsd.lib

但是,现在,我开始收到这些错误。

什么会导致这些问题?

非常感谢。
------ Build started: Project: hede, Configuration: Debug Win32 ------
Linking...
atlsd.lib(externs.obj) : error LNK2005: "char const * const g_pszUpdateEventName" (?g_pszUpdateEventName@@3PBDB) already defined in atls.lib(externs.obj)
atlsd.lib(externs.obj) : error LNK2005: "char const * const g_pszAllocFileMapName" (?g_pszAllocFileMapName@@3PBDB) already defined in atls.lib(externs.obj)
atlsd.lib(externs.obj) : error LNK2005: "char const * const g_pszKernelObjFmt" (?g_pszKernelObjFmt@@3PBDB) already defined in atls.lib(externs.obj)
atlsd.lib(externs.obj) : error LNK2005: "class CAtlAllocator g_Allocator" (?g_Allocator@@3VCAtlAllocator@@A) already defined in atls.lib(externs.obj)
SettingPropPage.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
stdafx.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
trace.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
util.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
genericpropclasses.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
hede.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
hede2.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
propclasses.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
propclasses.obj : error LNK2019: unresolved external symbol __imp__AtlWinModuleAddCreateWndData@12 referenced in function "public: void __thiscall ATL::CAtlWinModule::AddCreateWndData(struct ATL::_AtlCreateWndData *,void *)" (?AddCreateWndData@CAtlWinModule@ATL@@QAEXPAU_AtlCreateWndData@2@PAX@Z)
propclasses.obj : error LNK2019: unresolved external symbol "void __stdcall ATL::__FreeStdCallThunk(void *)" (?__FreeStdCallThunk@ATL@@YGXPAX@Z) referenced in function "public: static void __cdecl ATL::_stdcallthunk::operator delete(void *)" (??3_stdcallthunk@ATL@@SAXPAX@Z)
propclasses.obj : error LNK2019: unresolved external symbol __imp__AtlWinModuleExtractCreateWndData@4 referenced in function "public: void * __thiscall ATL::CAtlWinModule::ExtractCreateWndData(void)" (?ExtractCreateWndData@CAtlWinModule@ATL@@QAEPAXXZ)
propclasses.obj : error LNK2019: unresolved external symbol "void * __stdcall ATL::__AllocStdCallThunk(void)" (?__AllocStdCallThunk@ATL@@YGPAXXZ) referenced in function "public: static void * __cdecl ATL::_stdcallthunk::operator new(unsigned int)" (??2_stdcallthunk@ATL@@SAPAXI@Z)
stdafx.obj : error LNK2019: unresolved external symbol __imp__AtlUpdateRegistryFromResourceD@20 referenced in function "public: long __stdcall ATL::CAtlModule::UpdateRegistryFromResourceDHelper(wchar_t const *,int,struct ATL::_ATL_REGMAP_ENTRY *)" (?UpdateRegistryFromResourceDHelper@CAtlModule@ATL@@QAGJPB_WHPAU_ATL_REGMAP_ENTRY@2@@Z)
stdafx.obj : error LNK2019: unresolved external symbol __imp__AtlCreateRegistrar@4 referenced in function "public: long __stdcall ATL::CAtlModule::UpdateRegistryFromResourceDHelper(wchar_t const *,int,struct ATL::_ATL_REGMAP_ENTRY *)" (?UpdateRegistryFromResourceDHelper@CAtlModule@ATL@@QAGJPB_WHPAU_ATL_REGMAP_ENTRY@2@@Z)
stdafx.obj : error LNK2019: unresolved external symbol __imp__AtlCallTermFunc@4 referenced in function "public: void __thiscall ATL::CAtlModule::Term(void)" (?Term@CAtlModule@ATL@@QAEXXZ)
Debug/hede.exe : fatal error LNK1120: 8 unresolved externals
Build log was saved at "file://c:\Users\JohnDoe\Desktop\myproject\hede\Debug\BuildLog.htm"
hede- 20 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

最佳答案

我也必须调试这个问题。似乎 DLL bulid 不起作用,因为 atl.lib 中缺少许多函数。
我将“使用 ATL”切换为“静态链接到 ATL”。之后我只剩下 3 个缺少的符号,我发现这些符号是在 atlthunk.lib 中定义的。 .这个从未在 atlbase.h 中引用过。这就是我添加的原因

#pragma comment(lib, "atlthunk.lib")

atlbase.h就在 atls.lib/atlsd.lib 的调试是/否部分之前

之后构建成功。

关于linker - 基于 ATL 的链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11123475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com