[Revisit. solidmcp] porting from vs to GCC/codeblock

Source: Internet
Author: User

When building a solidmcp, I had the idea of X platform in the dark, and finally decided to start work tonight.

Download the codeblock and try to compile it with GCC. I found many errors. Modify it and take a note:

> Stray '\ 255' in program and null character (s) Warning

Bytes ------------------------------------------------------------------------------------

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
Bytes ------------------------------------------------------------------------------------

Or

Bytes ------------------------------------------------------------------------------------

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
Bytes ------------------------------------------------------------------------------------

Cause:

Asciitable. H is encoded as Unicode, and FF Fe is the so-called BOM of Unicode. However, the latter is gossip. Why is it sometimes gossip.

Solution:

Open it with notepad, Change Encoding to ANSI in the Save As dialog, re-compile, and solve the error.

For more information about Bom, see wiki.

> Invalid initialization of non-const reference

Bytes -----------------------------------------------------------------------------------

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' |

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

Cause:

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.

Solution:

Const base & derived = derived_2 ();

> Warning: No newline at end of file? Open link in new tab

Cause: There is no carriage return in the last line of source code. Solution: Press enter in the last line to re-compile. Check whether a script can solve this problem.> Requires compiler and library support for the upcoming Iso c ++ standard program c: \ Program Files \ codeblocks \ mingw \ bin \.. \ Lib \ GCC \ mingw32 \ 4.4.1 \ include \ 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 experim Ental, and must be enabled with the-STD = C ++ 0x or-STD = GNU ++ 0x compiler options. cause of failure: the header file C ++ 0x is referenced in the project, which can be traced all the way. The error here is due to tuple support.> Warning: NULL character (s) ignoreds:/Server/bedrock/config/details/asciitable. h: 1: 4: Warning: NULL character (s) ignored

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.