ofstream不被g ++识别?

时间:2015-05-25 06:17:31

标签: c++ g++ ofstream

以下C ++ ofstream代码在Microsoft Visual Studio 2012上运行

std::ofstream xyz_file;
xyz_file.open(movie_name, std::ios_base::app);

但是当使用G ++编译时,它会给出以下错误消息:

dynamics.cpp: In member function 'void dynamics::add_movie_frame(std::string)':
dynamics.cpp:142: error: no matching function for call to 'std::basic_ofstream<char, std::char_traits<char> >::open(std::string&, const std::ios_base::openmode&)'
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/fstream:696: note: candidates are: void std::basic_ofstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char, _Traits = std::char_traits<char>]

有什么想法吗?提前谢谢!

0 个答案:

没有答案