Tuesday, March 13, 2007

AtlWinModuleInit Error

while working with 2003 ,
I got an error in Directshow filters as follows
PsiParser error LNK2001: unresolved external symbol "class ATL::CAtlBaseModule ATL::_AtlBaseModule" (?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A)
PsiParser error LNK2019: unresolved external symbol "long __stdcall ATL::AtlWinModuleInit(struct ATL::_ATL_WIN_MODULE70 *)" (?AtlWinModuleInit@ATL@@YGJPAU_ATL_WIN_MODULE70@1@@Z) referenced in function "public: __thiscall ATL::CAtlWinModule::CAtlWinModule(void)" (??0CAtlWinModule@ATL@@QAE@XZ)


Solution :
You need to do one of two things.
Link with atls(d).lib OR remove atlbase.h and replace it with atlconv.h
atls.lib (release) and atlsd.lib (debug) appear to be the atl run time
libraries.
If you are only use atl conversion macros you can use the include file
atlconv.h in place of atlbase.h.
atl based com objects and executables need _Module defined in order to run
(alessandro is going to beat me up for being too simplistic [and maybe
wrong here!]). In VS2003 it appears that the run time has been put in a
library. If you are only using the conversion functions, you don't need
it.

No comments: