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