我正在使用 ogre3d + vld 并且遇到同样的问题!我用 GetLastError() 调试了错误代码:ERROR_PROC_NOT_FOUND,错误 127:找不到指定的过程。
好消息是,如果您注释掉该断言并重新编译,它可以工作(使用“new char[20]”测试),但如果您忘记调用“delete Ogre::Root::getSingletonPtr();” 它不会被检测到:(
编辑:要向调试控制台报告断言,您可以使用以下命令:
// Get the *real* address of the import.
import = GetProcAddress(exportmodule, importname);
if(import == NULL){
DWORD err=GetLastError();
WCHAR buff[2048];
wcsncpy_s(buff, 2048, L"\n============================================\nImport name: ", _TRUNCATE);
int i=wcslen(buff);
int n=0;
//cast to unicode
while(importname[n]){
buff[i++]=importname[n++];
}
buff[i]=0;
wcsncat_s(buff, 2048, L"\nExport module: ", _TRUNCATE);
i=wcslen(buff);
GetModuleFileName(exportmodule,&buff[i],2048-i);
wcsncat_s(buff, 2048, L"\nError code: ", _TRUNCATE);
i=wcslen(buff);
_itow_s(err,&buff[i],2048-i,10);
wcsncat_s(buff, 2048, L"\n============================================\n", _TRUNCATE);
report(buff);
}
//assert(import != NULL); // Perhaps the named export module does not actually export the named import?
结果将是:
============================================
导入名称:CoGetMalloc
导出模块:C:\data\projects\Avenon\trunk\source\..\build\Avenon_d.exe
错误代码:127
============================================
============================================
导入名称:CoTaskMemAlloc
导出模块:C:\data\projects\Avenon\trunk\source\..\build\Avenon_d.exe
错误代码:127
============================================
============================================
导入名称:CoTaskMemRealloc
导出模块:C:\data\projects\Avenon\trunk\source\..\build\Avenon_d.exe
错误代码:127
============================================