No but you should get a different error message when you do that. Your program will still not compile because it doesn't know what ifstream is, and you can't produce an executable file from just this file because there is no main function.
You should include <fstream> and write std::ifstream (because using namespace std; is not recommended in header files).
Geany treat .h files as C files, but there shouldn't be a need to compile header files separately (except maybe for your own convenience to see if there are any errors). The header files are included by source files, and it's the source files that you should compile.