lapucca
asked on
Need help with Compile err LNK2016
I have a C++ COM component built using only win32 lib. I added a couple of
files from MMC help sample files to my projects and now I'm getting these
link error when I compile. Can someone tell me how to correct this? Thank
you.
Error 36 fatal error LNK1120: 3 unresolved externals .\Debug/extProp.dll
Error 34 error LNK2019: unresolved external symbol "public: __thiscall
CDataObject::CDataObject(l ong,enum _DATA_OBJECT_TYPES)"
(??0CDataObject@@QAE@JW4_D ATA_OBJECT _TYPES@@@Z ) referenced in function
"public: virtual long __stdcall CComponentData::QueryDataO bject(long ,enum
_DATA_OBJECT_TYPES,struct IDataObject * *)"
(?QueryDataObject@CCompone ntData@@UA GJJW4_DATA _OBJECT_TY PES@@PAPAU IDataObjec t@@@Z) CompData.obj
Error 33 error LNK2019: unresolved external symbol "public: __thiscall
CComponent::CComponent(cla ss CComponentData *)"
(??0CComponent@@QAE@PAVCCo mponentDat a@@@Z) referenced in function "public:
virtual long __stdcall CComponentData::CreateComp onent(stru ct IComponent *
*)" (?CreateComponent@CCompone ntData@@UA GJPAPAUICo mponent@@@ Z) CompData.obj
Error 35 error LNK2019: unresolved external symbol "class CDataObject *
__cdecl GetOurDataObject(struct IDataObject *)"
(?GetOurDataObject@@YAPAVC DataObject @@PAUIData Object@@@Z ) referenced in
function "public: virtual long __stdcall
CComponentData::CompareObj ects(struc t IDataObject *,struct IDataObject *)"
(?CompareObjects@CComponen tData@@UAG JPAUIDataO bject@@0@Z ) CompData.obj
--
Thanks.
files from MMC help sample files to my projects and now I'm getting these
link error when I compile. Can someone tell me how to correct this? Thank
you.
Error 36 fatal error LNK1120: 3 unresolved externals .\Debug/extProp.dll
Error 34 error LNK2019: unresolved external symbol "public: __thiscall
CDataObject::CDataObject(l
(??0CDataObject@@QAE@JW4_D
"public: virtual long __stdcall CComponentData::QueryDataO
_DATA_OBJECT_TYPES,struct IDataObject * *)"
(?QueryDataObject@CCompone
Error 33 error LNK2019: unresolved external symbol "public: __thiscall
CComponent::CComponent(cla
(??0CComponent@@QAE@PAVCCo
virtual long __stdcall CComponentData::CreateComp
*)" (?CreateComponent@CCompone
Error 35 error LNK2019: unresolved external symbol "class CDataObject *
__cdecl GetOurDataObject(struct IDataObject *)"
(?GetOurDataObject@@YAPAVC
function "public: virtual long __stdcall
CComponentData::CompareObj
(?CompareObjects@CComponen
--
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was missing dataobject.cpp. Once I added that I am now down to one compiling error. It seems to say that problem calling CComponentData::CreateComp onent. I have the CompData.cpp and .h file already in my project. Why am I still getting this error? Thank you.
Error 33 error LNK2019: unresolved external symbol "public: __thiscall CComponent::CComponent(cla ss CComponentData *)" (??0CComponent@@QAE@PAVCCo mponentDat a@@@Z) referenced in function "public: virtual long __stdcall CComponentData::CreateComp onent(stru ct IComponent * *)" (?CreateComponent@CCompone ntData@@UA GJPAPAUICo mponent@@@ Z) CompData.obj
Error 33 error LNK2019: unresolved external symbol "public: __thiscall CComponent::CComponent(cla
Any other file there that contains the constructor 'CComponent::CComponent'?
check the function CComponentData::CreateComp onent in compdata.cpp
There must be a statement like
pComponent = new CComponent(this);
If so, you have to add the constructor "CComponent::CComponent(CC omponentDa ta *)" to dataobject.h and dataobject.cpp, but don't ask me how to implement it. I don't know that sample and what is the purpose of these classes.
There must be a statement like
pComponent = new CComponent(this);
If so, you have to add the constructor "CComponent::CComponent(CC
Seems like the file which you have added have some dependent dll which you might have to include in your project settings. It is looking for some functions in the relying dll
Best Regards,
Deepu Abraham K