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

bug? : g++: `ios::ios(const ios &)' is private



hi

if `date -u` is later than Thu Dec 13 20:00:00 UTC 2001 
then please skip this message




we are trying to port some code from Window$ to Debian

I found the below behaviour which may be a bug, and have posted it as
such... but maybe it is not a bug (I am not very good at c++)

may someone give a look?

thanks

a.

----- Forwarded message from Andrea Mennucc <debian@tonelli.sns.it> -----

From: Andrea Mennucci <debian@tonelli.sns.it>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: g++: `ios::ios(const ios &)' is private

Subject: : `ios::ios(const ios &)' is private
Package: g++
Version: 2:2.95.4-8
Severity: normal


hi

I include a piece of code, as first attachment, and the error that I get,
as second attachment

it exemplifies an error that I have already found twice

also, this piece of code compiles ok using Micro$oft Visual c++

I am not good at c++ but I suppose that this code should not
result into that error

a.

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux Tonelli 2.4.14-686 #1 Fri Nov 9 22:25:26 EST 2001 i686
Locale: LANG=it_IT, LC_CTYPE=it_IT

Versions of packages g++ depends on:
ii  cpp                    2:2.95.4-8        The GNU C preprocessor.
ii  g++-2.95               1:2.95.4-0.011006 The GNU C++ compiler.
ii  gcc-2.95               1:2.95.4-0.011006 The GNU C compiler.



----------------code

#include <fstream.h>

typedef char SYMBOL_TYPE;

class file_handler_type
{
public:
	file_handler_type();
	file_handler_type(const char* p_file_name,
					  int p_open_mode);
	~file_handler_type();
	virtual bool open(const char* p_file_name,
					  int p_open_mode); 
	virtual bool close();
	virtual bool is_open();
	virtual bool eof();
	virtual bool get_bit (unsigned short int& p_bit);
	virtual bool put_bit (const unsigned short int  p_bit);
	virtual bool get_symbol (SYMBOL_TYPE& p_symbol);
	virtual bool put_symbol (const SYMBOL_TYPE  p_symbol); 
	fstream	m_file;
	int		m_open_mode;
	bool	m_is_open;
	bool	m_eof;
};

class model_extractor_type
{
public:
	model_extractor_type(file_handler_type p_symbols_file);
	SYMBOL_TYPE*	   m_symbols_vector;
	unsigned long int* m_intervals_vector;
	unsigned long int  m_cardinality;
};

void main ()
{

	file_handler_type symbol_file;
	model_extractor_type* model_extractor = NULL;
	symbol_file.open("/etc/motd",ios::in);
	model_extractor = new model_extractor_type(symbol_file);
}


---------------- error


cd ~/Work/CC/Fedrigo/
make test
g++     test.cpp   -o test
test.cpp: In method `fstream::fstream(const fstream &)':
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h:128: `ios::ios(const ios &)' is private
test.cpp:42: within this context
test.cpp: In method `fstreambase::fstreambase(const fstreambase &)':
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h:128: `ios::ios(const ios &)' is private
test.cpp:42: within this context
test.cpp: In method `iostream::iostream(const iostream &)':
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h:128: `ios::ios(const ios &)' is private
test.cpp:42: within this context
test.cpp: In method `istream::istream(const istream &)':
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h:128: `ios::ios(const ios &)' is private
test.cpp:42: within this context
test.cpp: In method `ostream::ostream(const ostream &)':
/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/streambuf.h:128: `ios::ios(const ios &)' is private
test.cpp:42: within this context
make: *** [test] Error 1

Compilation exited abnormally with code 2 at Thu Dec 13 15:59:08


----- End forwarded message -----

-- 
A Mennucc
 "È un mondo difficile. Che vita intensa!" (Renato Carotone)



Reply to: