I use Eigen C++ matrix library with Eclipse on ubuntu. Here is the simple code:
#include <iostream>
#include <eigen3/Eigen/Core>
using namespace Eigen;
using namespace std;
int main() {
VectorXcd spec(5);
spec(4) = std::complex<double>(1, 2);
cout << spec(4).imag() << "\n";
return 0;
}
It runs ok, but eclipse indicates a semantic error called "Method 'imag' could not be resolved". Phenomenons as this also occur in my own project with Eigen. I use several 3rd party libraries, but such errors only relate to Eigen. However, if I switch to visual studio 2013 under windows, everything is ok, and I can also come into the implementation of the relevant code in Eigen library.
I guess it is parsing problem for template library.