I am trying to use Eclipse CDT with the Cygwin GCC toolchain in order to read in some images using png++. I have installed the png++ headers (I tried both 0.2.5 and 0.2.7) in my Cygwin, and it compiles fine using the external builder settings with make, but for some reason the editor underlines "image" from png::image in the very simple code:
#include <png++/png.hpp>
int main( int argc, char* argv[]){
png::image<png::gray_pixel> t(128,128);
return 1;
}
And gives the error:
Invalid template arguments.
I looked around a bit for this error, and it seems for other people it was caused by not having GCC set to use C++11 (such as Invalid template arguments on map std::map< std::string, Stock*> &stocks), but I do not think that is an issue with me, since I have my "CDT GCC Built-in Compiler Settings Cygwin" provider command set to:
${COMMAND} ${FLAGS} -E -P -v -dD -std=c++11 "${INPUTS}"
And the line std::normal_distribution<double> distribution(5.0,2.0);
does not give an error.
I can remove the error underline by turning off "Invalid template argument" under the project properties -> C/C++ General -> Code Analysis, but the problem is deeper than that, as none of the auto-completes will work for the object of type png::image, and if I try and use it in a function, for example:
void pngTest(png::image<png::gray_pixel> im, int other) {}
it gives the error: Invalid arguments ' Candidates are: void pngTest(?, int) '
So it seems it does not resolve the type at all. What might be causing this?