Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29261 Discussions

linking with dll's produced by previous version of MS developer studio

Terry_Wong
Beginner
699 Views
I recently installed MS Visual Studio 2010 and Fortran XE 12.
Previously, I had installed MS Visual Studio 2005 and Fortran 9.1. My application has several C++ libraries that I link in. I had built my libraries with MS Visual Studio 2005.

Now, when I try to build my app with my new setup, I am having difficulty linking with the old C++ libraries.
I believe that I am using the same external procedure settings (C, reference; upper case; string length argument after individual strings; no underscore appends). Yet I am getting error LNK2001 and LNK2019 which are unresolved external symbol"__declspec(dllimport) ...."

Would it help to re-compile my dll's with MS Visual Studio 2010. I don't see why I would need to.
Any other ideas about what I could be doing wrong?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
699 Views
Please show the complete actual error message(s). I am confused when you refer to __declspec(dllimport) - as that would be from C or C++, but you say you are linking with C++ libraries. Can you attach the buildlog.htm from the Debug or Release folder?
0 Kudos
Terry_Wong
Beginner
699 Views
I tried rebuilding one of the C++ libraries and that seemed to do away with the error messages from that library, but I don't have the source code for a couple of them, so I haven't been able to re-compile them yet.


The exact error messages I'm getting are as follows. Does this give you any clue?

cplus.lib(stringutil.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::find_first_not_of(char const *,unsigned __int64,unsigned __int64)const " (__imp_?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z) referenced in function "void __cdecl StripLeading(class std::basic_string,class std::allocator > &,char)" (?StripLeading@@YAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@D@Z)

cplus.lib(stringutil.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned __int64 __cdecl std::basic_string,class std::allocator >::find_last_not_of(char const *,unsigned __int64,unsigned __int64)const " (__imp_?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z) referenced in function "void __cdecl StripTrailing(class std::basic_string,class std::allocator > &,char)" (?StripTrailing@@YAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@D@Z)

cplus.lib(stringutil.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string,class std::allocator >::npos" (__imp_?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2_KB) referenced in function "void __cdecl StripTrailing(class std::basic_string,class std::allocator > &,char)" (?StripTrailing@@YAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@D@Z)

cplus.lib(viptoken.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string,class std::allocator >::npos" (__imp_?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2_KB)

cplus.lib(stringutil.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_string,class std::allocator >::swap(class std::basic_string,class std::allocator > &)" (__imp_?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEAV12@@Z) referenced in function "void __cdecl std::swap,class std::allocator >(class std::basic_string,class std::allocator > &,class std::basic_string,class std::allocator > &)" (??$swap@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z)

cplus.lib(vipstring.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_string,class std::allocator >::clear(void)" (__imp_?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ) referenced in function "public: class std::basic_istream > & __cdecl VipString::readToken(class std::basic_istream > &)" (?readToken@VipString@@QEAAAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@AEAV23@@Z)

cplus.lib(vipstring.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > & __cdecl std::basic_string,class std::allocator >::insert(unsigned __int64,char const *,unsigned __int64)" (__imp_?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KPEBD0@Z) referenced in function "public: class std::basic_istream > & __cdecl VipString::readFile(class std::basic_istream > &)" (?readFile@VipString@@QEAAAEAV?$basic_istream@DU?$char_traits@D@std@@@std@@AEAV23@@Z)

x64\Debug/simulator_debug.exe : fatal error LNK1120: 6 unresolved externals

0 Kudos
Reply