- 目前有三种解决方法。
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版本程序运行不了的问题。
4. 删除project目录下的debug子目录。只能暂时解决问题,新建project时还是会出现问题。
*5. Another option is to add the following line in Project -> Properties ->
[Debug Configuration] -> Configuration Properties -> Linker -> Manifest
File -> Additional Manifest Dependencies:
type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0'
processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'
This will add the appropriate reference to MSVCR80.dll, and will not force
you to use static libs.
这种方法比较彻底。