在把vc6.0下的項目移植到vs2005下,將所有的編譯錯誤都改完了,然後運行出現:
HEAP[****.exe]: Invalid Address specified to RtlFreeHeap( 00390000, 003BB3F8 )
因爲程序中使用了OpenCV庫,我發現用的是release版本的OpenCV庫,所以需要將OpenCV源碼重新編譯一份debug版本的(我用的OpenCV1.0)。編譯的時候直接打開OpenCV安裝目錄下的_make中的工程文件即可。
使用了debug版本的庫後,又出現瞭如下錯誤:
Runtime Error!
Program: ****\*.exe
R6034
"An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."
**.exe 中的 0x7c9866c6 處未處理的異常: 0xC0000142: DLL Initialization Failed
在網上找了一些答案:最終有效的是
在 stdafx.h加入這句
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\"")
vs2008的話改成VC90.CRT
version='8.0.50608.0' 改成你的vs的版本。