Eclipse C + + standard library error:: mbstate_t have not been declared

Source: Internet
Author: User

In the process of using eclipse to develop embedded software, including <iostream> immediately after the error, just remove the include command without any errors and warnings, compile error message as shown:

The first thing to note is that the engineering code has no errors, because the error message shows that the location of the error is the system's header file. After reviewing the data, it is known that such errors occur because of a conflict between the C language extension of GCC and the C standard.

Look for the cause of the error: Into the project directory, in the Debug directory Eclispe has automatically generated makefile, enter this directory on the terminal, enter the Make command, get the compiler output more trust information, In the first error message, you can see that the compiler gives you an error prompt and a workaround: "and must is enabled with the-std=gnu++0x complier options." As shown in:

So, right-click on the project name, select Properties->c/c++ build->setting->tool Setting, select three compilers and linker, and in command line The last addition of-std=gnu++0x in pattern,

Here-std= means to choose the C language compilation standard, here selected is the C + + language GNU compilation standard. Compile the project again with Eclipse, and you can see that there are no errors.

Eclipse C + + standard library error:: mbstate_t have not been declared

Related Article

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.