第一步,是卸载dll先后顺序的问题,让OgreMain_d.dll在mfc80d.dll之前析构,老外早就有分析了:
i) in the General tab, switch "Use MFC in a shared DLL" to "Use Standard Windows Libraries"
ii) in the C/C++/Preprocessor tab, add _AFXDLL to the preprocessor definitions
iii) in the Linker/Input tab, add mfc90ud.lib anywhere before OgreMain_d.lib
 
第二步,删除自己代码中的所有的#defin new DEBUG_NEW,然后在 CApp的构造函数中加入 AfxEnableMemoryTracking(FALSE);
出现错误:
1>Compiling...
1>stdafx.cpp
1>d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxver_.h(81) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
解决方法:
c/c++ ---- Code Generation --------- runtime library 改为 “Multi-threaded Debug DLL (/MDd)”
i) in the General tab, switch "Use MFC in a shared DLL" to "Use Standard Windows Libraries"
ii) in the C/C++/Preprocessor tab, add _AFXDLL to the preprocessor definitions
iii) in the Linker/Input tab, add mfc90ud.lib anywhere before OgreMain_d.lib
第二步,删除自己代码中的所有的#defin new DEBUG_NEW,然后在 CApp的构造函数中加入 AfxEnableMemoryTracking(FALSE);
出现错误:
1>Compiling...
1>stdafx.cpp
1>d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxver_.h(81) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
解决方法:
c/c++ ---- Code Generation --------- runtime library 改为 “Multi-threaded Debug DLL (/MDd)”
第三部,如果出现“error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用  
.exe : fatal error LNK1120: 1 个无法解析的外部命令”的错误,请将编码方式由unicode改为多字节编码即可。
 
                    
                     
                    
                 
                    
                 
         
