I am facing a lot of saying
Symbol 'array' could not be resolved
, with code that is building fine.
#include <math.h>
#include <array>
#include <sstream>
#include <string>
static std::string printArray(std::array<double, 3> data) {
std::ostringstream strs;
strs << "( " << data[0] << " " << data[1] << " " << data[2] << " )";
return strs.str();
}
static std::string printVector(std::vector<double> data) {
std::ostringstream strs;
strs << "( " ;
for (const auto & value : data )
strs << value << " ";
strs << " )";
return strs.str();
}
The c++11 feature are activated using the -std=c++11
flag under C/C++ General -> Preposcessor Include Path, Macros etc. -> Porvides -> CDT GCC Built-in Compiler Settings
as described here or here.
My question is no duplicate, since it works for std::vector
and other c++11 features are handled correctly.
The header (#include <array>
) can be resolved by pressing F3.
I am using Eclipse the CDT Version: Neon.3 Release (4.6.3).