Hi All,
I have succeeded in compiling a massive project, originally from vc6 to VS .Net 2005.
Now, while linking I am having loads of linker errors with the above code.
LNK20019 and LNK2001. Giving error msg that some symbol is not found. Actually, the library with the symbol has been already compiled as dll.
I looked into the documentation. The errors may be caused by
1. use of Inline functions (2019, also sometimes 2001)
2. use of C Runtime LIbraries (2001)
I dont know how to solve this problem. Can anybody tell me what should I do to remove these errors ?
I know all the missing symbols are there and the libraries are my own, so I can also change the code of the libraries.
this is the buildlog of one of the projects in the solution.
I also attach the implementation of a small class which is referenced and the symbol (destructor of that class) is not found and results in the error.
I hope this helps you guys to guide me.
Command Line
Code:
Creating temporary file "c:\hardik\VidPIVSrc\VidPIV 3.0\CrossCorrelation\Debug\RSP0000183284168.rsp" with contents
[
/OUT:".\Debug/CrossCorrelation.dll" /INCREMENTAL /LIBPATH:"..\Lib\Debug" /DLL /MANIFEST /MANIFESTFILE:".\Debug\CrossCorrelation.dll.intermediate.manifest" /SUBSYSTEM:WINDOWS /IMPLIB:".\Debug/CrossCorrelation.lib" /MACHINE:X86 /FORCE:MULTIPLE ..\CrossCorrelationLib\Debug\CrossCorrelation.exp "..\vdpvtimelib\debug\vdpvtime.lib" "..\utilities\debug\vdpvutils.lib" "..\broker\debug\vdpvbroker.lib" "..\vdpvderivationslib\debug\vdpvderivations.lib" "..\crosscorrelationlib\debug\crosscorrelation.lib" "..\fakeimporter\debug\fakeimporter.lib" "..\vdpvannotationlib\debug\vdpvannotation.lib" "..\vdpvvector\debug\vdpvvector.lib" "..\vdpvvisualisations\debug\vdpvvisualisations.lib" "..\vdpvderived\debug\vdpvderived.lib"
"..\CrossCorrelationLib\Debug\CrossCorrelationlib.lib"
".\Debug\CrossCorrelation.res"
".\Debug\CrossCorrelation.dll.embed.manifest.res"
]
Creating command line "link.exe @"c:\hardik\VidPIVSrc\VidPIV 3.0\CrossCorrelation\Debug\RSP0000183284168.rsp" /NOLOGO /ERRORREPORT:PROMPT"
Output Window
Code:
Linking...
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
crosscorrelation.lib(CrossCorrelation.obj) : warning LNK4006: _VdpvDllInfo@4 already defined in vdpvtime.lib(VdpvTime.dll); second definition ignored
crosscorrelation.lib(CrossCorrelation.obj) : warning LNK4006: _VdpvClassInfo@32 already defined in vdpvtime.lib(VdpvTime.dll); second definition ignored
crosscorrelation.lib(CrossCorrelation.obj) : warning LNK4006: _DllMain@12 already defined in vdpvderivations.lib(VdpvDerivations.dll); second definition ignored
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019:unresolved external symbol "__declspec(dllimport) public: __thiscall int_iterator::~int_iterator(void)" (__imp_??1?$int_iterator@VCDerivedMap@@@@QAE@XZ) referenced in function "public: void __thiscall CCrossCorrelation::doCorrelation(struct CCorrelationThreadData &)" (?doCorrelation@CCrossCorrelation@@QAEXAAUCCorrelationThreadData@@@Z)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CTemplateHandle::operator class CGrid *(void)const " (__imp_??B?$CTemplateHandle@VCGrid@@@@QBEPAVCGrid@@XZ) referenced in function "public: bool __thiscall CCrossCorrelation::Interrogate(class CTemplateHandleWithClsid const &,class CTemplateHandleWithClsid const &,class CTemplateHandleWithClsid const &,class CTemplateHandleWithClsid const &,class CSingleVectorMap *)" (?Interrogate@CCrossCorrelation@@QAE_NABV?$CTemplateHandleWithClsid@VCSingleBitmap@@@@ABV?$CTemplateHandleWithClsid@VCGrid@@@@01PAVCSingleVectorMap@@@Z)
crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall CTemplateHandle::operator class CGrid *(void)const " (__imp_??B?$CTemplateHandle@VCGrid@@@@QBEPAVCGrid@@XZ)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class CGrid * __thiscall CTemplateHandle::operator->(void)const " (__imp_??C?$CTemplateHandle@VCGrid@@@@QBEPAVCGrid@@XZ) referenced in function "public: bool __thiscall CCrossCorrelation::Interrogate(class CTemplateHandleWithClsid const &,class CTemplateHandleWithClsid const &,class CTemplateHandleWithClsid const &,class CTemplateHandleWithClsid const &,class CSingleVectorMap *)" (?Interrogate@CCrossCorrelation@@QAE_NABV?$CTemplateHandleWithClsid@VCSingleBitmap@@@@ABV?$CTemplateHandleWithClsid@VCGrid@@@@01PAVCSingleVectorMap@@@Z)
crosscorrelation.lib(FindBestPulseSeperationDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class CGrid * __thiscall CTemplateHandle::operator->(void)const " (__imp_??C?$CTemplateHandle@VCGrid@@@@QBEPAVCGrid@@XZ)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CTemplateHandleWithClsid::~CTemplateHandleWithClsid(void)" (__imp_??1?$CTemplateHandleWithClsid@VCSingleVectorMap@@@@UAE@XZ) referenced in function __unwindfunclet$?Apply@CCrossCorrelation@@UAEXPAVCDerivationData@@PAVCUIItemContext@@H@Z$0
crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CTemplateHandleWithClsid::~CTemplateHandleWithClsid(void)" (__imp_??1?$CTemplateHandleWithClsid@VCSingleVectorMap@@@@UAE@XZ)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CFindExclusions::~CFindExclusions(void)" (__imp_??1CFindExclusions@@UAE@XZ) referenced in function "public: virtual void __thiscall CCrossCorrelation::Apply(class CDerivationData *,class CUIItemContext *,int)" (?Apply@CCrossCorrelation@@UAEXPAVCDerivationData@@PAVCUIItemContext@@H@Z)
crosscorrelation.lib(FindBestPulseSeperationDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CFindExclusions::~CFindExclusions(void)" (__imp_??1CFindExclusions@@UAE@XZ)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CTemplateHandle::operator class CSingleVectorMap *(void)const " (__imp_??B?$CTemplateHandle@VCSingleVectorMap@@@@QBEPAVCSingleVectorMap@@XZ) referenced in function "public: virtual void __thiscall CCrossCorrelation::Apply(class CDerivationData *,class CUIItemContext *,int)" (?Apply@CCrossCorrelation@@UAEXPAVCDerivationData@@PAVCUIItemContext@@H@Z)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class CSingleVectorMap * __thiscall CTemplateHandle::operator->(void)const " (__imp_??C?$CTemplateHandle@VCSingleVectorMap@@@@QBEPAVCSingleVectorMap@@XZ) referenced in function "public: virtual void __thiscall CCrossCorrelation::Apply(class CDerivationData *,class CUIItemContext *,int)" (?Apply@CCrossCorrelation@@UAEXPAVCDerivationData@@PAVCUIItemContext@@H@Z)
crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class CSingleVectorMap * __thiscall CTemplateHandle::operator->(void)const " (__imp_??C?$CTemplateHandle@VCSingleVectorMap@@@@QBEPAVCSingleVectorMap@@XZ)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CFindExclusions::CFindExclusions(class CTreeHandler *,struct _TREEITEM *,class ATL::CStringT > > const &)" (__imp_??0CFindExclusions@@QAE@PAVCTreeHandler@@PAU_TREEITEM@@ABV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function "public: virtual void __thiscall CCrossCorrelation::Apply(class CDerivationData *,class CUIItemContext *,int)" (?Apply@CCrossCorrelation@@UAEXPAVCDerivationData@@PAVCUIItemContext@@H@Z)
crosscorrelation.lib(FindBestPulseSeperationDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall CFindExclusions::CFindExclusions(class CTreeHandler *,struct _TREEITEM *,class ATL::CStringT > > const &)" (__imp_??0CFindExclusions@@QAE@PAVCTreeHandler@@PAU_TREEITEM@@ABV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
crosscorrelation.lib(CorrelationCross.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) const CTemplateHandleWithClsid::`vftable'" (__imp_??_7?$CTemplateHandleWithClsid@VCSingleVectorMap@@@@6B@) referenced in function "public: virtual void __thiscall CCrossCorrelation::Apply(class CDerivationData *,class CUIItemContext *,int)" (?Apply@CCrossCorrelation@@UAEXPAVCDerivationData@@PAVCUIItemContext@@H@Z)
crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) const CTemplateHandleWithClsid::`vftable'" (__imp_??_7?$CTemplateHandleWithClsid@VCSingleVectorMap@@@@6B@)
crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) const CTemplateHandle::`vftable'" (__imp_??_7?$CTemplateHandle@VCSingleVectorMap@@@@6B@) referenced in function "public: __thiscall CCorrelationViewerDlg::CCorrelationViewerDlg(class CWnd *)" (??0CCorrelationViewerDlg@@QAE@PAVCWnd@@@Z)
crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CTemplateHandleWithClsid::CTemplateHandleWithClsid(class ATL::CStringT > > const &)" (__imp_??0?$CTemplateHandleWithClsid@VCSingleVectorMap@@@@QAE@ABV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function "public: void __thiscall CCorrelationViewerDlg::OnDisplayMouseMove(class CMouseData *)" (?OnDisplayMouseMove@CCorrelationViewerDlg@@QAEXPAVCMouseData@@@Z)
.\Debug/CrossCorrelation.dll : fatal error LNK1120: 11 unresolved externals
Results
Code:
CrossCorrelation - 19 error(s), 4 warning(s)
Sample Class file related to the first linking error
Code:
#ifndef _INCLUDED_ITERATOR_
#define _INCLUDED_ITERATOR_
#ifndef __UtilitiesAfxExt_h__
#include "UtilitiesAfxExt.h"
#endif
#include <iterator>
template < class C >
class AFX_EXT_UTILITIES int_iterator : public std::iterator<std::random_access_iterator_tag,C>
{
friend C;
int m_iIndex;
public:
int_iterator() : m_iIndex( 0 ) {}
int_iterator( int iIndex ) : m_iIndex ( iIndex ) {}
int_iterator( const int_iterator& it ) : m_iIndex( it.m_iIndex ) {}
int_iterator& operator=( const int_iterator& it ){ m_iIndex = it.m_iIndex; return *this; }
int_iterator& operator++() { ++m_iIndex; return *this; }
int_iterator& operator--() { --m_iIndex; return *this; }
int_iterator operator++(int) { return int_iterator(m_iIndex++); }
int_iterator operator--(int) { return int_iterator(m_iIndex--); }
int_iterator operator+(const int_iterator &r) { return int_iterator(m_iIndex+r.m_iIndex); }
int_iterator operator-(const int_iterator &r) { return int_iterator(m_iIndex-r.m_iIndex); }
int_iterator& operator+=(distance_type offset) { m_iIndex+=offset; return *this; }
int_iterator& operator-=(distance_type offset) { m_iIndex-=offset; return *this; }
bool operator!=( const int_iterator& rhs ) const { return m_iIndex != rhs.m_iIndex; }
bool operator==( const int_iterator& rhs ) const { return m_iIndex == rhs.m_iIndex; }
int operator*() const { return m_iIndex; }
};
#endif
thanks,
Hardik