Linux compile C + + error stray ' \357 ' in program__ static function

Source: Internet
Author: User

When the Linux side compiled so, a stray ' \357 ' in the program was reported as an error.

There are probably two possible ways:

1. The source file contains Chinese characters (comments are not counted).

2. The source file encoding format adopts the UTF-8 with BOM format.

Then I looked at the problem of coding format, as long as you save it as a different encoding format to recompile.

In addition, there is no error when compiling Windows side, you can compile it.

It should be purely just Linux that does not accept UTF-8 with the BOM format code.


In addition, error LNK2005: __cinit already defined in Libcmt.lib (crt0dat.obj) type error occurred while compiling the project in Windows environment.

Typically, because the two default libraries are conflicting with each other, such a problem can block one or more of these libraries by ignoring the specified library in the project (or project)-> Property-> linker->.

If you still have a compile error after shielding one, you may be masking the wrong object, and you can try to block another library.

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.