C/C++拾遗录--编程中的编译错误
2012-07-02 18:01
85 查看
1.问题:error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format
解决方法:用UltraEdit查看发现好到不必要的字符。例如“?”等,去掉即可。可以在另存为成DOS格式
2.问题:error C2447: '{' : missing function header (old-style formal list?)
解决方法:原来是函数声明和函数体之间多了一个“;”
3.LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
解决方法:该错误发生在VS2010中右键->工程属性->配置属性-> 清单工具->输入和输出->嵌入清单,选择[否]。如果程序中用到了资源文件,那么这个方法就无效了。最后使用VS2012就好了。
4.error LNK2001: 无法解析的外部符号 "protected: virtual struct AFX_MSGMAP const * __thiscall SelectDLG::GetMessageMap(void)const " (?GetMessageMap@SelectDLG@@MBEPBUAFX_MSGMAP@@XZ)
解决方法:在类中多了一个“DECLARE_MESSAGE_MAP()”。删掉就可以了。
5.1>d:\projects\detectingcovertchannels\detectingcovertchannels\detectingcovertchannelsdlg.cpp(103): error C2039: “format”: 不是“ATL::CStringT<BaseType,StringTraits>”的成员
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
解决方法:这个问题出现的原因是在调用Format成员时,错用称format。而且Format调用时需要对字符串进行_T("*****")处理。
解决方法:用UltraEdit查看发现好到不必要的字符。例如“?”等,去掉即可。可以在另存为成DOS格式
2.问题:error C2447: '{' : missing function header (old-style formal list?)
解决方法:原来是函数声明和函数体之间多了一个“;”
3.LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
解决方法:该错误发生在VS2010中右键->工程属性->配置属性-> 清单工具->输入和输出->嵌入清单,选择[否]。如果程序中用到了资源文件,那么这个方法就无效了。最后使用VS2012就好了。
4.error LNK2001: 无法解析的外部符号 "protected: virtual struct AFX_MSGMAP const * __thiscall SelectDLG::GetMessageMap(void)const " (?GetMessageMap@SelectDLG@@MBEPBUAFX_MSGMAP@@XZ)
解决方法:在类中多了一个“DECLARE_MESSAGE_MAP()”。删掉就可以了。
5.1>d:\projects\detectingcovertchannels\detectingcovertchannels\detectingcovertchannelsdlg.cpp(103): error C2039: “format”: 不是“ATL::CStringT<BaseType,StringTraits>”的成员
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
解决方法:这个问题出现的原因是在调用Format成员时,错用称format。而且Format调用时需要对字符串进行_T("*****")处理。
相关文章推荐
- 【网络SOCKET编程】DEV-C/C++ 编译时出现undefined reference to `WSAStartup@8'等错误解决办法
- C++模板的声明与实现分离 编译错误详解
- C++编程人员容易犯的10个C#错误
- VS(C++)编程遇到的错误集合
- C++ 编程错误记录
- C++ 常见编译错误解决办法
- 混合语言编程:启用CLR(公共语言运行时编译)让C#调用C++
- c++编译错误:invalid new-expression of abstract class type
- [ c++] cmake 编译时 undefined reference to `std::cout' 错误的解决方案
- c/c++高质量编程中的一点错误
- TURBOC编译错误信息说明大全 C++错误提示
- linux下编译c++程序遇到 error: ‘thread’ is not a member of ‘std’的错误
- C++——编程常见错误
- C++编程技巧减少编译时间
- C++编程人员容易犯的10个C#错误
- 【编程题目】数值的整数次方——关于代码完整性及错误处理方式的探讨(C++实现)
- C/C++编程常见问题(2)-错误打印64位长整数
- C++模板函数中含有数据类型成员时导致编译错误(显示未知类型)的解决方法
- gcc 编译c++常见错误汇总
- C & C++ 中值得注意的编译,链接,调试,错误及其原因