visual studio 2012 - LNK1120 error - VS2012 project using a VS2010 DLL -
i have third party dll compiled vc10 (vs2010). exports following function:
bool mydll_exports_api myfunction(std::vector<int>::const_iterator c) { return true; }
my exe uses dll. trying compile exe vc11 (vs2012).
#include "stdafx.h" #include <vector> #include "mydll_vc10\mydll_vc10.h" int _tmain(int argc, _tchar* argv[]) { std::vector<int>::const_iterator c; myfunction(c); return 0; }
i following linker error:
1>usingdllvc10.obj : error lnk2019: unresolved external symbol "__declspec(dllimport) bool __cdecl >myfunction(class std::_vector_const_iterator > >)" (_imp?myfunction@@ya_nv?$_vector_const_iterator@v?$_vector_val@u?>$_simple_types@h@std@@@std@@@std@@@z) referenced in function _wmain 1>c:\work\training\vectorreproducebug\usingdllvc10\debug\usingdllvc10.exe : fatal error lnk1120: 1 >unresolved externals
note: code compiles , links if exe compiled vc10 (vs2010). how fix linker error without third party library compiled vc11 (vs2012)?
you can't. compiled binaries different based on compiler used compile it, dll's generated vs2010 not compatible vs2012. way fix re-compile old 2010 library source 2012 version.
Comments
Post a Comment