Hey I'm not too sure about this but it's one of two things:
1. You forgot to put usingnamespace std;
or
2. If you have multiple files you may have linked them up incorrectly try have one main.h where all the header files are included and all of your .cpp files have #include "main.h" at the top
Hope this helps :)
Oh and by the way can I ask why you are using File *myfile and not ifstream *myfile, just curious.
I was very kind and created a solution that DOES work without errors, but it's with ifstream, so if you don't won't to use it for some reason try my second suggestion in my first post