目前有三種解決方法。
1, 在程序cpp文件里加上下面句子:
#ifdef _DEBUG
#define __LIBRARIES_SUB_VERSION Debug
#else
#define __LIBRARIES_SUB_VERSION
#endif
// Manifest for the CRT
#pragma comment(linker,/manifestdependency:\type= win32 \
name= __LIBRARIES_ASSEMBLY_NAME_PREFIX .
__LIBRARIES_SUB_VERSION CRT \
version= _CRT_ASSEMBLY_VERSION \
processorArchitecture= x86 \)
// Manifest for the MFC
#pragma comment(linker,/manifestdependency:\type= win32 \
name= __LIBRARIES_ASSEMBLY_NAME_PREFIX .
__LIBRARIES_SUB_VERSION MFC \
version= _CRT_ASSEMBLY_VERSION \
processorArchitecture= x86 \)
#pragma comment(linker,/manifestdependency:\type= win32 \
name= __LIBRARIES_ASSEMBLY_NAME_PREFIX .MFCLOC \
version= _CRT_ASSEMBLY_VERSION \
processorArchitecture= x86 \)
可參考:
http://www.codeproject.com/cpp/PrivateAssemblyProjects.asp?msg=2122107
2, 在程序cpp文件里加上下面句子:
#pragma comment(linker, \/manifestdependency:type= Win32 name= Microsoft.VC80.CRT version= 8.0.50608.0 processorArchitecture= X86 publicKeyToken= 1fc8b3b9a1e18e3b language= * \)
可參考:
http://jewelry-wolf.spaces.live.com/blog/cns!9041D1290EF347B0!591.entry
3, 在項目屬性 C/C++ 的Command Line 里加上
/D _VC80_UPGRADE=0x0710
可以解決debug版本程序運行不了的問題。
這是作者本人發(fā)現(xiàn)的法子,很實用。原理未明。