std::cerr and add missing headers