ofstream is inside of namespace std. Use it like this

Code:
std::ofstream f;