2013-06-24 83 views
0

我有一个DLL项目,编译,链接和正常工作与Visual Studio 6VisualStudio的6到VS2010迁移:奇怪的链接错误

现在,我已经装好了到Visual Studio 2010在旧的进口。 dsp文件VS2010问我要转换为.vcxproj文件。从那以后,我尝试编译新转换的项目,但在调试建立在这个奇怪的链接错误绊倒:

error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: struct oapc_bin_head * const & __thiscall std::_Deque_const_iterator<struct oapc_bin_head *,class std::allocator<struct oapc_bin_head *> >::operator*(void)const " ([email protected][email protected]@[email protected][email protected]@@[email protected]@@[email protected]@[email protected]@XZ) 

的_DEBUG编译开关在调试模式以及NDEBUG在释放模式定义。令人惊讶的是在发布模式下,错误是非常不同的:

error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" ([email protected]@@[email protected]) referenced in function "protected: void __thiscall std::deque<struct oapc_bin_head *,class std::allocator<struct oapc_bin_head *> >::_Xlen(void)const " ([email protected][email protected][email protected]@[email protected][email protected]@@[email protected]@@[email protected]@IBEXXZ) 

任何想法在项目文件转换期间丢失了什么?

谢谢!

+0

此答案有帮助吗? http://stackoverflow.com/questions/6003368/unresolved-externals-in-c-when-using-vectors-and-find和这个链接http://forum.ragezone.com/f728/vs2010-packui-fix-错误-lnk2019-784831/ – Amitd

+0

不,对不起,没有帮助。 _DEBUG在调试版本中是强制性的,(不仅)assert()不存在时不能正常工作。 – Elmi

+0

解决了至少调试版本问题:链接必须针对msvcrtd.lib而不是msvcrt.lib – Elmi

回答

0

它看起来像你有某种问题与链接到标准的DLL。 它可以像在x64中构建其中一个,而在x86中构建其中一个,只是不会将dll添加到链接或类似的东西。

你可以发布visual studio使用的连接器命令吗?

+0

/OUT:"../plugins/rtc.dll“/ INCREMENTAL/NOLOGO/LIBPATH:”..“/ DLL “../liboapc/Debug/liboapc.lib”msvcrt.lib“”Ws2_32.lib“”kernel32.lib“”user32.lib“”gdi32.lib“”winspool.lib“”comdlg32.lib“”advapi32。 lib“”shell32.lib“”ole32.lib“”oleaut32.lib“”uuid.lib“”odbc32.lib“”odbccp32.lib“/ MANIFEST /ManifestFile:".\Debug\rtc.dll.intermediate.manifest”/ALLOWISOLATION/MANIFESTUAC:“level ='asInvoker'uiAccess ='false'”/ DEBUG /PDB:"F:\demos\Debug\rtc.pdb“/ SUBSYSTEM:CONSOLE/PGD:”F:\ demos \ Debug \ rtc .pgd“/ TLBID:1/DYNAMICBASE/NXCOMPAT /IMPLIB:".\Debug\rtc.lib”/ MACHINE:X86/ERRORREPORT:QUEUE – Elmi