Eclipse signals an error, but code compilation

I am writing C ++ code with eclipe.

I have strange behavior with vector objects.

When I use a method resize, for example, Eclipse returns the following error:

#include "vector"

   ...

   vector<int> a;
   a.resize(5);

   Error: Invalid arguments candidates are: void resize(?, int).

However, the code is compiled from the command line.

How can I fix this squeamish eclipse behavior?

+5
source share
1 answer

After some time searching and adjusting the settings, I think I found the answer. For proper processing by the code indexer, I had to:

  • Right click project -> Properties
  • Go to C / C ++ General -> Preprocessor Include paths, macros, etc.
  • Go to the suppliers tab
  • Check CDT GCC Compiler Component
  • To apply
  • Restore index
+6

All Articles