zoukankan      html  css  js  c++  java
  • [Revisit.SolidMCP] Porting from VS to GCC/CodeBlock

    在堆砌SolidMCP的时候,暗地里是有着X Platform的想法的,今晚终于下决心开工了。

    Download了CodeBlock并试着用GCC编译一把,发现错误很多啊,慢慢修改并做个笔记吧:

    >>  stray '\255' in program 与 null character(s) warning

    ------------------------------------------------------------------------------------

    s:/Server/BedRock/Config/Details/ASCIITable.h:1: error: stray '\255' in program
    s:/Server/BedRock/Config/Details/ASCIITable.h:1: error: stray '\254' in program
    ------------------------------------------------------------------------------------

    Or

    ------------------------------------------------------------------------------------

    s:/Server/BedRock/Config/Details/ASCIITable.h:1: error: stray '\377' in program
    s:/Server/BedRock/Config/Details/ASCIITable.h:1: error: stray '\376' in program
    ------------------------------------------------------------------------------------

    原因:

    ASCIITable.h的编码是Unicode,FF FE 应该就是Unicode的所谓BOM。只不过后者是八进制的罢了,为什么有时候会八进制,尚未可知。

    解决方案:

    用Notepad打开,在另存为对话中把将Encoding改为Ansi,重新编译,错误解决。

    更多关于BOM的东西,可以看wiki

    >> invalid initialization of non-const reference

    -----------------------------------------------------------------------------------

    Base& pDerived  = Derived_2();

    S:\Server\BedRock\iTry\Try_Std_Casts.cpp|160|error: invalid initialization of non-const reference of type 'Base&' from a temporary of type 'Derived_2'|

    ----------------------------------------------------------------------------------

    原因:

    1. We must use an initializer for any const or reference member or for any member of a class type that does not have a default constructor.

    2. A nonconst reference may be attached only to an object of the same type as the reference itself.

    A const reference may be bound to an object of a different but related type or to an rvalue.

    解决方案:

    const Base& derived = Derived_2();

    >> warning: no newline at end of file?Open link in new tab

    原因:
    在源代码最后一行没有回车。
    解决方案:
    在最后一行搞一个回车即可再重新编译即可。看看能不能搞个script解决这个问题。
    >> requires compiler and library support for the upcoming ISO C++ standard
    ---------------------------------------------------------------------------------------------------
    c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\c++0x_warning.h|31|
    error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x.
    This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
    -----------------------------------------------------------------------------------------------------
    原因:
    在工程中引用了C++0X的头文件,一路追根溯源总是能找到的。我这里的错误则为源自于对tuple的支持。
    >> warning: null character(s) ignored
    s:/Server/BedRock/Config/Details/ASCIITable.h:1:4: warning: null character(s) ignored
  • 相关阅读:
    java OA系统 自定义表单 流程审批 电子印章 手写文字识别 电子签名 即时通讯
    flowable 获取当前任务流程图片的输入流
    最新 接口api插件 Swagger3 更新配置详解
    springboot 集成 activiti 流程引擎
    java 在线考试系统源码 springboot 在线教育 视频直播功能 支持手机端
    阿里 Nacos 注册中心 配置启动说明
    springboot 集成外部tomcat war包部署方式
    java 监听 redis 过期事件
    springcloudalibaba 组件版本关系
    java WebSocket 即时通讯配置使用说明
  • 原文地址:https://www.cnblogs.com/piaoger/p/2042725.html
Copyright © 2011-2022 走看看