[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/33242] New: Getting error when including fstream.
From: |
firefox256 at yahoo dot com |
Subject: |
[Bug classpath/33242] New: Getting error when including fstream. |
Date: |
29 Aug 2007 23:46:40 -0000 |
Here is the code
//Seg.cpp
#include <iostream>
#include <fstream>
#define SEGSIZE 2000
using namespace std;
class Seg
{
fstream file;
unsigned long pos;
char buff[SEGSIZE];
public:
Seg(char * name)
{
}
void open(char * name)
{
//file.open(name, fstream::in | fstream::out |
fstream::binary);
pos = 0;
}
~Seg()
{
//file.close();
}
unsigned long GetNew()
{
//file.seekp(0, ios_base::end);
//pos = file.tellp();
//file.write(buff, SEGSIZE);
//file.flush();
//file.seekp(pos);
return 0;
}
};
int main()
{
Seg s1 = Seg("tasdfklj");
return 0;
}
when fstream file; is commented out it works just fine but when included
fstream file; get the following error.
here is the error
g++ Seg.cpp -o Seg
/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_ios<char,
std::char_traits<char> >::basic_ios(const std::basic_ios<char,
std::char_traits<char> >&)':
/usr/include/c++/4.0.0/bits/ios_base.h:779: error:
'std::ios_base::ios_base(const std::ios_base&)' is private
/usr/include/c++/4.0.0/iosfwd:55: error: within this context
/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_fstream<char,
std::char_traits<char> >::basic_fstream(const std::basic_fstream<char,
std::char_traits<char> >&)':
/usr/include/c++/4.0.0/iosfwd:95: warning: synthesized method
'std::basic_ios<char, std::char_traits<char> >::basic_ios(const
std::basic_ios<char, std::char_traits<char> >&)' first required here
/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_filebuf<char,
std::char_traits<char> >::basic_filebuf(const std::basic_filebuf<char,
std::char_traits<char> >&)':
/usr/include/c++/4.0.0/streambuf:772: error: 'std::basic_streambuf<_CharT,
_Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with
_CharT = char, _Traits = std::char_traits<char>]' is private
/usr/include/c++/4.0.0/iosfwd:86: error: within this context
/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_fstream<char,
std::char_traits<char> >::basic_fstream(const std::basic_fstream<char,
std::char_traits<char> >&)':
/usr/include/c++/4.0.0/iosfwd:95: warning: synthesized method
'std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(const
std::basic_filebuf<char, std::char_traits<char> >&)' first required here
Seg.cpp: In copy constructor 'Seg::Seg(const Seg&)':
Seg.cpp:9: warning: synthesized method 'std::basic_fstream<char,
std::char_traits<char> >::basic_fstream(const std::basic_fstream<char,
std::char_traits<char> >&)' first required here
Seg.cpp: In function 'int main()':
Seg.cpp:45: warning: synthesized method 'Seg::Seg(const Seg&)' first required
here
--
Summary: Getting error when including fstream.
Product: classpath
Version: unspecified
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: classpath
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: firefox256 at yahoo dot com
GCC build triplet: 20061115
GCC host triplet: g++ version 4.0.1 on mac power pc and linux g++ version
4.1.2 on
GCC target triplet: 4.0.1 4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33242
- [Bug classpath/33242] New: Getting error when including fstream.,
firefox256 at yahoo dot com <=