学习C++过程中,尝试着将自己遇到的编译错误贴出,算是小回顾,慢慢再添加。
error c101008a: Failed to save the updated manifest to the file
解决方法:Project Properties -> Configuration Properties -> Manifest Tool -> Command Line
Under Additional options, enter " /validate_manifest "
error C2664: “CWnd::MessageBoxW”: 不能将参数 1 从“const char [12]”转换为“LPCTSTR” [1]
解决方法:
项目属性 -> 配置属性 -> 常规 -> 字符集 中“Unicode”改为“多字符”
另一种解决方案是:将需处理的字符串加上_T,_T是一个宏,其作用是把一个引号引起来的字符串,根据你的环境设置,使得编译器会根据目标环境选择合适的(UNICODE或ANSI)字符处理方式。另有_L,不管你用什么方式编译,一律以UNICODE方式保持。
error LNK2019: 无法解析的外部符号 "int __cdecl get_info(int,class std...)
出错原因:函数声明但未定义,可能是个别参数形式不符
解决方法:修改函数定义或声明,也可以重载函数