In the previous version of C++ (C++03), open() takes only a const char * for the first parameter, instead of std::string. The correct way of calling it would then be:
myFile.open(filename.c_str());
In current C++ (C++11) that code is fine, though, so see if you can tell your compiler to enable support for it.