作者:朱金灿

       晚上编译一个ATL程序,出现一些诡异的错误:

1>CGreet.obj : error LNK2001: unresolved externalsymbol __forceAtlDllManifest

1>dllmain.obj : error LNK2001: unresolved externalsymbol __forceAtlDllManifest

1>SayHello.obj : error LNK2001: unresolved externalsymbol __forceAtlDllManifest

1>stdafx.obj : error LNK2001: unresolved externalsymbol __forceAtlDllManifest

1>CGreet.obj : error LNK2019: unresolved externalsymbol __imp__AtlUpdateRegistryFromResourceD@20 referenced in function"public: long __stdcallATL::CAtlModule::UpdateRegistryFromResourceDHelper(wchar_t const *,int,structATL::_ATL_REGMAP_ENTRY *)" (?UpdateRegistryFromResourceDHelper@CAtlModule@ATL@@QAGJPB_WHPAU_ATL_REGMAP_ENTRY@2@@Z)

1>SayHello.obj : error LNK2001: unresolved externalsymbol __imp__AtlUpdateRegistryFromResourceD@20

1>CGreet.obj : error LNK2019: unresolved externalsymbol __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)

1>SayHello.obj : error LNK2001: unresolved externalsymbol __imp__AtlCreateRegistrar@4

1>dllmain.obj : error LNK2019: unresolved externalsymbol __imp__AtlGetPerUserRegistration@4 referenced in function_AtlUnRegisterTypeLib@8

1>SayHello.obj : error LNK2001: unresolved externalsymbol __imp__AtlGetPerUserRegistration@4

1>stdafx.obj : error LNK2001: unresolved externalsymbol __imp__AtlGetPerUserRegistration@4

1>dllmain.obj : error LNK2019: unresolved externalsymbol __imp__AtlLoadTypeLib@16 referenced in function _AtlUnRegisterTypeLib@8

1>SayHello.obj : error LNK2001: unresolved externalsymbol __imp__AtlLoadTypeLib@16

1>stdafx.obj : error LNK2001: unresolved externalsymbol __imp__AtlLoadTypeLib@16

1>dllmain.obj : error LNK2019: unresolved externalsymbol __imp__AtlCallTermFunc@4 referenced in function "public: void__thiscall ATL::CAtlModule::Term(void)" (?Term@CAtlModule@ATL@@QAEXXZ)

1>SayHello.obj : error LNK2019: unresolved externalsymbol __imp__AtlSetPerUserRegistration@4 referenced in function _DllInstall@8

1>SayHello.obj : error LNK2019: unresolved externalsymbol __imp__AtlComModuleGetClassObject@16 referenced in function"public: long __thiscall ATL::CAtlDllModuleT<classCSayHelloModule>::GetClassObject(struct _GUID const &,struct _GUID const&,void * *)" (?GetClassObject@?$CAtlDllModuleT@VCSayHelloModule@@@ATL@@QAEJABU_GUID@@0PAPAX@Z)

1>Debug\SayHello.dll : fatal error LNK1120: 8unresolved externals

Operating System:- Windows 7 Professional

        初步判断这是缺少链接库造成的,但是找了半天也不知道缺少链接哪些库。后来发现这个错误非常容易解决,原来是之前的工程设置了忽略所有默认库,只需要改为将该项设置为否即可,如下图:

unresolved external symbol __forceAtlDllManifest错误的解决_unresolved external