468,257 Members | 1,431 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

errors LNK2001 and LNK2019 with VS .net 2005

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.

here 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
Expand|Select|Wrap|Line Numbers
  1. Creating temporary file "c:\hardik\VidPIVSrc\VidPIV 3.0\CrossCorrelation\Debug\RSP0000183284168.rsp" with contents
  2. [
  3. /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"
  4. "..\CrossCorrelationLib\Debug\CrossCorrelationlib.lib"
  5. ".\Debug\CrossCorrelation.res"
  6. ".\Debug\CrossCorrelation.dll.embed.manifest.res"
  7. ]
  8. Creating command line "link.exe @"c:\hardik\VidPIVSrc\VidPIV 3.0\CrossCorrelation\Debug\RSP0000183284168.rsp" /NOLOGO /ERRORREPORT:PROMPT"
  9.  
  10. Output Window
  11. LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
  12. crosscorrelation.lib(CrossCorrelation.obj) : warning LNK4006: _VdpvDllInfo@4 already defined in vdpvtime.lib(VdpvTime.dll); second definition ignored
  13. crosscorrelation.lib(CrossCorrelation.obj) : warning LNK4006: _VdpvClassInfo@32 already defined in vdpvtime.lib(VdpvTime.dll); second definition ignored
  14. crosscorrelation.lib(CrossCorrelation.obj) : warning LNK4006: _DllMain@12 already defined in vdpvderivations.lib(VdpvDerivations.dll); second definition ignored
  15. 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)
  16. 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)
  17. 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)
  18. 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)
  19. 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)
  20. 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
  21. crosscorrelation.lib(CorrelationViewerDlg.obj) : error LNK2001: unresolved ...........some more errors 
  22.  : fatal error LNK1120: 11 unresolved externals
  23.  
  24. The sample class responsible for the first error.
  25.  
  26. #ifndef _INCLUDED_ITERATOR_
  27. #define _INCLUDED_ITERATOR_
  28.  
  29. #ifndef __UtilitiesAfxExt_h__
  30. #include "UtilitiesAfxExt.h"
  31. #endif
  32.  
  33. #include <iterator>
  34.  
  35. template < class C >
  36. class AFX_EXT_UTILITIES int_iterator : public std::iterator<std::random_access_iterator_tag,C>
  37. {
  38.     friend C;
  39.  
  40.     int            m_iIndex;
  41.  
  42. public:
  43.     int_iterator() : m_iIndex( 0 ) {}
  44.     int_iterator( int iIndex ) : m_iIndex ( iIndex ) {}
  45.     int_iterator( const int_iterator& it ) : m_iIndex( it.m_iIndex ) {}
  46.     int_iterator& operator=( const int_iterator& it ){ m_iIndex = it.m_iIndex; return *this; }
  47.  
  48.  
  49.  
  50.     int_iterator& operator++() { ++m_iIndex; return *this; }
  51.     int_iterator& operator--() { --m_iIndex; return *this; }
  52.     int_iterator operator++(int) { return int_iterator(m_iIndex++); }
  53.     int_iterator operator--(int) { return int_iterator(m_iIndex--); }
  54.     int_iterator operator+(const int_iterator &r) { return int_iterator(m_iIndex+r.m_iIndex); }
  55.     int_iterator operator-(const int_iterator &r) { return int_iterator(m_iIndex-r.m_iIndex); }
  56.     int_iterator& operator+=(distance_type offset) { m_iIndex+=offset; return *this; }
  57.     int_iterator& operator-=(distance_type offset) { m_iIndex-=offset; return *this; }    
  58.     bool operator!=( const int_iterator& rhs ) const { return m_iIndex != rhs.m_iIndex; }
  59.     bool operator==( const int_iterator& rhs ) const { return m_iIndex == rhs.m_iIndex; }
  60.     int operator*() const { return m_iIndex; }
  61. };
  62.  
  63.  
  64. #endif
  65.  
thanks,
Hardik
May 10 '06 #1
2 4966
Banfa
9,033 Expert Mod 8TB
LNK20019 and LNK2001. Giving error msg that some symbol is not found. Actually, the library with the symbol has been already compiled as dll.
In my experience you will just have to take the long route of wading through the erros trying to fix them.

However if you have already compiled the code that contains the unresolved symbols into a dll then a couple of possibilities are
  • You have not included the .lib from that DLL into the current link
  • You have not declared those functions as dllexport when you compiled/linked the original dll.
May 10 '06 #2
Hi,
thanks for the reply.

I have already compiled the concerned code. I also export/import the functions. The code is compiling and working well with vc6.

the problems is how to fix this errors when we have properly exported and compiled functino ?
May 10 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by KS | last post: by
reply views Thread by Adam Clauss | last post: by
1 post views Thread by iiitsunny | last post: by
2 posts views Thread by 2b|!2b==? | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.