I have just installed Eclipse CDT on my machine for developping C++ applications.
I have created a new C++ project. I have copied a cpp file.
When I click the build button, the project compile without errors.
However, I have a problem. The problem is that Eclipse tell me that there is many errors. For example Eclipse show that “using namespace std” is an error or that “#include ” is an error.
I don’t know what is the problem with Eclipse because my file compile properly when i click the “build” button.
Is there some settings that I did not set properly?
Thanks!
You need to add the paths to the std libraries to your project in eclipse. It seems that somehow eclipse did not find your std library.
You need to add the path to your gcc include under:
properties->C/C++ General->Paths and Symbols->Includes->GNU C and GNU C++
The paths GCC/G++ uses can be found by the commands in this answer to “Where does gcc look for C and C++ header files?”.