Click here to Skip to main content
12,401,628 members (31,171 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: MFC ATL COM
So what would you suggest, I have resolved the ambuguity errors by making slight modification. For example
Previously it was..

CEdit m_ctlUsedDuration;

I changed it to

WTL::CEdit m_ctlUsedDuration;


Now the compiler is able to recognize that these classes belong to ATL not MFC, however it has spawn to some new errors listed below



1>LINK : warning LNK4199: /DELAYLOAD:OleAcc.dll ignored; no imports found from OleAcc.dll
1>UndoBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>Utils.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>Plug_In.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>Project_Interface_Reports.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>Project_Native.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>Project_Reports.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>AddIn.obj : error LNK2019: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ) referenced in function "int __cdecl AfxCrtErrorCheck(int)" (?AfxCrtErrorCheck@@YAHH@Z)
1>Connect.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>FilterBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>InputBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowInvalidArgException(void)" (?AfxThrowInvalidArgException@@YGXXZ)
1>Utils.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Project_Native.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Project_Reports.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Trial.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>UndoBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>InputBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Plug_In.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Project.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Project_Interface_Reports.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>AddIn.obj : error LNK2019: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ) referenced in function "int __cdecl AfxCrtErrorCheck(int)" (?AfxCrtErrorCheck@@YAHH@Z)
1>Application.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Connect.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>FilterBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowMemoryException(void)" (?AfxThrowMemoryException@@YGXXZ)
1>Project_Reports.obj : error LNK2019: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z) referenced in function "public: __thiscall std::vector<class CCPM::CTaskError,class std::allocator<class CCPM::CTaskError> >::vector<class CCPM::CTaskError,class std::allocator<class CCPM::CTaskError> >(class std::vector<class CCPM::CTaskError,class std::allocator<class CCPM::CTaskError> > const &)" (??0?$vector@VCTaskError@CCPM@@V?$allocator@VCTaskError@CCPM@@@std@@@std@@QAE@ABV01@@Z)
1>Trial.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>UndoBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Utils.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Plug_In.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Project.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Project_Interface_Reports.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Project_Native.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Application.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Connect.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>FilterBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>InputBox.obj : error LNK2001: unresolved external symbol "void __stdcall AfxThrowOleException(long)" (?AfxThrowOleException@@YGXJ@Z)
1>Connect.obj : error LNK2019: unresolved external symbol "public: void __thiscall CException::Delete(void)" (?Delete@CException@@QAEXXZ) referenced in function __catch$?CreateInstance@?$CComCreator@V?$CComObjectCached@VCComClassFactory@ATL@@@ATL@@@ATL@@SGJPAXABU_GUID@@PAPAX@Z$0
1>FilterBox.obj : error LNK2001: unresolved external symbol "public: void __thiscall CException::Delete(void)" (?Delete@CException@@QAEXXZ)
1>Plug_In.obj : error LNK2001: unresolved external symbol "public: void __thiscall CException::Delete(void)" (?Delete@CException@@QAEXXZ)
1>UndoBox.obj : error LNK2001: unresolved external symbol "public: void __thiscall CException::Delete(void)" (?Delete@CException@@QAEXXZ)
1>InputBox.obj : error LNK2019: unresolved external symbol "struct HINSTANCE__ * __stdcall AfxFindStringResourceHandle(unsigned int)" (?AfxFindStringResourceHandle@@YGPAUHINSTANCE__@@I@Z) referenced in function "public: static struct HINSTANCE__ * __cdecl StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> >::FindStringResourceInstance(unsigned int)" (?FindStringResourceInstance@?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@SAPAUHINSTANCE__@@I@Z)
1>Project_Interface_Reports.obj : error LNK2001: unresolved external symbol "struct HINSTANCE__ * __stdcall AfxFindStringResourceHandle(unsigned int)" (?AfxFindStringResourceHandle@@YGPAUHINSTANCE__@@I@Z)
1>Project_Reports.obj : error LNK2001: unresolved external symbol "struct HINSTANCE__ * __stdcall AfxFindStringResourceHandle(unsigned int)" (?AfxFindStringResourceHandle@@YGPAUHINSTANCE__@@I@Z)
1>Utils.obj : error LNK2001: unresolved external symbol "struct HINSTANCE__ * __stdcall AfxFindStringResourceHandle(unsigned int)" (?AfxFindStringResourceHandle@@YGPAUHINSTANCE__@@I@Z)
1>InputBox.obj : error LNK2019: unresolved external symbol "struct ATL::IAtlStringMgr * __stdcall AfxGetStringManager(void)" (?AfxGetStringManager@@YGPAUIAtlStringMgr@ATL@@XZ) referenced in function "public: static struct ATL::IAtlStringMgr * __cdecl StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> >::GetDefaultManager(void)" (?GetDefaultManager@?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@SAPAUIAtlStringMgr@ATL@@XZ)
1>Project_Interface_Reports.obj : error LNK2001: unresolved external symbol "struct ATL::IAtlStringMgr * __stdcall AfxGetStringManager(void)" (?AfxGetStringManager@@YGPAUIAtlStringMgr@ATL@@XZ)
1>Project_Reports.obj : error LNK2001: unresolved external symbol "struct ATL::IAtlStringMgr * __stdcall AfxGetStringManager(void)" (?AfxGetStringManager@@YGPAUIAtlStringMgr@ATL@@XZ)
1>Utils.obj : error LNK2001: unresolved external symbol "struct ATL::IAtlStringMgr * __stdcall AfxGetStringManager(void)" (?AfxGetStringManager@@YGPAUIAtlStringMgr@ATL@@XZ)
1>Trial.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CFont::~CFont(void)" (??1CFont@@UAE@XZ) referenced in function "protected: long __thiscall CCPM::Dialogs::CTrial::OnInitDialog(unsigned int,unsigned int,long,int &)" (?OnInitDialog@CTrial@Dialogs@CCPM@@IAEJIIJAAH@Z)
1>Trial.obj : error LNK2019: unresolved external symbol "public: __thiscall CFont::operator struct HFONT__ *(void)const " (??BCFont@@QBEPAUHFONT__@@XZ) referenced in function "protected: long __thiscall CCPM::Dialogs::CTrial::OnInitDialog(unsigned int,unsigned int,long,int &)" (?OnInitDialog@CTrial@Dialogs@CCPM@@IAEJIIJAAH@Z)
1>Trial.obj : error LNK2019: unresolved external symbol "public: int __thiscall CFont::CreateFontW(int,int,int,int,int,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,wchar_t const *)" (?CreateFontW@CFont@@QAEHHHHHHEEEEEEEEPB_W@Z) referenced in function "protected: long __thiscall CCPM::Dialogs::CTrial::OnInitDialog(unsigned int,unsigned int,long,int &)" (?OnInitDialog@CTrial@Dialogs@CCPM@@IAEJIIJAAH@Z)
1>Trial.obj : error LNK2019: unresolved external symbol "public: __thiscall CFont::CFont(void)" (??0CFont@@QAE@XZ) referenced in function "protected: long __thiscall CCPM::Dialogs::CTrial::OnInitDialog(unsigned int,unsigned int,long,int &)" (?OnInitDialog@CTrial@Dialogs@CCPM@@IAEJIIJAAH@Z)
1>Debug/CCPM.dll : fatal error LNK1120: 10 unresolved externals



So can you help me in resolving these errors? I didn't mess up with any of the .lib file used. I guess once this thing is resolved I will be able to implement MFC with this project.

Otherwise you are always welcomed to tell me alternatives

Thanks in Advance
Posted 10-Feb-10 19:50pm
Updated 11-Feb-10 5:20am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You are still using MFC, but don't link to it.

The easiest way I found is to recreate the Project as ATL project, tick "MFC support" in the wizard and re-add / merge the files.




btw. it would be more reader-friendly if you wouldn't just dump the linker output but listed what you figured out from it - e.g. listing the symbols that are not found.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

This project already has 100s of files, resources. Creating a new ATL Project and adding all these files is not gonna be fun. These erroes comes if my active build is Debug mode, In Release mode I just receive 2 errors

<pre lang="msil">1>uafxcw.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in AddIn.obj
1>   Creating library Release/CCPM.lib and object Release/CCPM.exp
1>Release/CCPM.dll : fatal error LNK1169: one or more multiply defined symbols found
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 18 Feb 2010
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100