R
Raven
When switching from VC7.0 to VC7.1 I've encountered a problem:
I have a plugin class like
class ATL_NO_VTABLE CDataFlowPlugIn :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CDataFlowPlugIn, &CLSID_DataFlowPlugIn>,
public IPreferencesEventSink,
public:
CDataFlowPlugIn();
DECLARE_NO_REGISTRY()
BEGIN_COM_MAP(CDataFlowPlugIn)
COM_INTERFACE_ENTRY(IPlugIn)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPlugInWorkspaceEventSink)
COM_INTERFACE_ENTRY(IPreferencesEventSink)
COM_INTERFACE_ENTRY(IFrameSystemEventsEventSink)
END_COM_MAP()
....}
I have linker errors in module:
DataFlow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
(__imp_?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@
QAEKXZ) referenced in function "public: virtual unsigned long __stdcall
ATL::CComObject<class CDataFlowPlugIn>::AddRef(void)"
(?AddRef@?$CComObject@VCDataFlowPlugIn@@@ATL@@UAGKXZ)
Engine.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
(__imp_?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@
QAEKXZ)
DataFlow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalRelease(void)"
(__imp_?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@
@QAEKXZ) referenced in function "public: virtual unsigned long __stdcall
ATL::CComObject<class CDataFlowPlugIn>::Release(void)"
(?Release@?$CComObject@VCDataFlowPlugIn@@@ATL@@UAGKXZ)
Engine.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalRelease(void)"
(__imp_?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@
@QAEKXZ)
...\..\Release\bin\DataFlow.dll : fatal error LNK1120: 2 unresolved externals
For example such line as
OBJECT_ENTRY_AUTO(CLSID_DataFlowPlugIn, CDataFlowPlugIn)
makes unresolved linker error in ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
In VC6.0 and 7.0 this problem was solved like said in microsoft KB article -
class __declspec(dllimport) CComObjectRootEx<CComSingleThreadModel>;
But now compiler was changed and I can't find a wat to make it all linking
normally. Even nobody in office can't now.
It looks like the template class CComObjectRootEc functions must have code
generated for instance in CComSingleThreadModel but there is no code
actually.
What can be done here?
Eugene
I have a plugin class like
class ATL_NO_VTABLE CDataFlowPlugIn :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CDataFlowPlugIn, &CLSID_DataFlowPlugIn>,
public IPreferencesEventSink,
public:
CDataFlowPlugIn();
DECLARE_NO_REGISTRY()
BEGIN_COM_MAP(CDataFlowPlugIn)
COM_INTERFACE_ENTRY(IPlugIn)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IPlugInWorkspaceEventSink)
COM_INTERFACE_ENTRY(IPreferencesEventSink)
COM_INTERFACE_ENTRY(IFrameSystemEventsEventSink)
END_COM_MAP()
....}
I have linker errors in module:
DataFlow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
(__imp_?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@
QAEKXZ) referenced in function "public: virtual unsigned long __stdcall
ATL::CComObject<class CDataFlowPlugIn>::AddRef(void)"
(?AddRef@?$CComObject@VCDataFlowPlugIn@@@ATL@@UAGKXZ)
Engine.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
(__imp_?InternalAddRef@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@@
QAEKXZ)
DataFlow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalRelease(void)"
(__imp_?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@
@QAEKXZ) referenced in function "public: virtual unsigned long __stdcall
ATL::CComObject<class CDataFlowPlugIn>::Release(void)"
(?Release@?$CComObject@VCDataFlowPlugIn@@@ATL@@UAGKXZ)
Engine.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: unsigned long __thiscall
ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalRelease(void)"
(__imp_?InternalRelease@?$CComObjectRootEx@VCComSingleThreadModel@ATL@@@ATL@
@QAEKXZ)
...\..\Release\bin\DataFlow.dll : fatal error LNK1120: 2 unresolved externals
For example such line as
OBJECT_ENTRY_AUTO(CLSID_DataFlowPlugIn, CDataFlowPlugIn)
makes unresolved linker error in ATL::CComObjectRootEx<class
ATL::CComSingleThreadModel>::InternalAddRef(void)"
In VC6.0 and 7.0 this problem was solved like said in microsoft KB article -
class __declspec(dllimport) CComObjectRootEx<CComSingleThreadModel>;
But now compiler was changed and I can't find a wat to make it all linking
normally. Even nobody in office can't now.
It looks like the template class CComObjectRootEc functions must have code
generated for instance in CComSingleThreadModel but there is no code
actually.
What can be done here?
Eugene