C++: variable ‘std::ifstream ifs’ has initializer but incomplete type

This seems to be answered – #include <fstream>. The message means :- incomplete type – the class has not been defined with a full class. The compiler has seen statements such as class ifstream; which allow it to understand that a class exists, but does not know how much memory the class takes up. The forward declaration allows the … Read more