0

Receiving debugger notifications in the IDE; however the project compiles and runs fine. I have added flags for X0 in an attempt to remedy the problem (thinking debugger software might be pre-c++11), but that has not remedied the issue. I'm experiencing the issue with arrays directly, but have seen it occur with other data types. I have tried refreshing the index in the project and "freshening" the files. I'm also receiving an odd 'invalid overload of endl' notification. Code below is just for experimenting with the IDE. Errors located at every line with an array class function call and the cout statements.

Any thoughts?

#include <iostream>
#include <array>
using namespace std;

int main()
{

    array <double, 5> rainfall;

    rainfall[0] = 2.3;
    rainfall[1] = 0.3;
    rainfall[2] = 0.0;
    rainfall[3] = 4.1;
    rainfall[4] = 0.5;

    rainfall.at(5) = 7.2;

    for(size_t x = 0; x < rainfall.size(); x++)
    {

        cout << rainfall[x] << endl;

    }

    for(size_t x = 0; x < rainfall.size(); x++)
        {

            cout << "Please enter a rainfall amount: " << endl;

            cin >> rainfall[x];

        }

    for(size_t x = 0; x < rainfall.size(); x++)
        {

            cout << rainfall[x] << endl;

        }

    return 0;

}
StormsEdge
  • 854
  • 2
  • 10
  • 35

1 Answers1

0

See this answer: https://stackoverflow.com/a/22001437/1274747

By default the indexer parser does not have C++11 enabled, so to use the C++11 functionality and classes, the -std=c++11 parameter needs to be added to the index parser command line.

You can also check the other answers in the thread, but this one was working in my case.

Community
  • 1
  • 1
EmDroid
  • 5,918
  • 18
  • 18
  • Axalis unfortunately I tried all of the recommended solutions in that thread and none of them have worked. I'm still seeing all of the error notifications. I added experimental as well. Also added C++11 and tried to the c++0X – StormsEdge May 20 '16 at 13:53
  • Did you also try to restart the Eclipse and manually rebuild the index for the particular project? – EmDroid May 20 '16 at 14:54
  • I restarted Eclipse. Just to clarify by manually rebuild the index you mean right click select index and then select rebuild? If so, then yes I did. Otherwise, I may not have. – StormsEdge May 20 '16 at 15:26