compile error ios::ios(const ios &)' is private?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi 
when i migrate code from windows to linux, the gcc gives me the
following error message:
main.cpp: In method `ofstream::ofstream(const ofstream &)':
/usr/local/.5.8/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/../../../../include/g++-3/streambuf.h:128:
`ios::ios(const ios &)' is private

the code is as follows,
#include <iostream>
int main()
{
    	ofstream result;
	result.open("resultfile");
	if(result.fail())
	{
		cout<<"Can not open the result file"<<endl;
		exit(-1);
	}
                Path_Table table2(34);
                TreePattern tree1;
                tree1.EvaluatingQuery(&table2, result);
                return 0;
}

please tell me the reasons for such error message, thank you very much!

Ni Yuan

-- 
Regards!


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux