This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: problems porting Common-C++
- To: libstdc++ at sources dot redhat dot com
- Subject: Re: problems porting Common-C++
- From: Felix Natter <f dot natter at ndh dot net>
- Date: 20 Jun 2001 16:12:29 +0200
- References: <87n174cu46.fsf@mybaby.home.felix>
Felix Natter <f.natter@ndh.net> writes:
> hi,
>
> I am currently trying to port commoncpp (Common-C++, can be found
> on a GNU-mirror) to gcc 3.x, and I have a few problems:
>
> - i/ostream::init(streambuf*): make this publicly accessible ?:
Sorry, this is wrong. The real problem is that commoncpp uses
the empty constructor of iostream (or ostream or istream), which
libstdc++-v3 does not provide. The code looks somewhat like this:
TCPStream::TCPStream() : std::streambuf(), std::iostream()
{
std::iostream::init((std::streambuf*)this);
}
and I hope that this will work:
TCPStream::TCPStream() : std::streambuf(), std::iostream(this)
{
}
there is one more problem (in the demo directory):
- unsetf(std::ios::binary) missing:
tcpthread.cpp: In constructor `myTCPSession::myTCPSession(cc_TCPSocket&)':
tcpthread.cpp:88: no matching function for call to `myTCPSession::unsetf(const
std::_Ios_Openmode&)'
/opt/gcc3/include/g++-v3/bits/ios_base.h:340: candidates are: void
std::ios_base::unsetf(std::_Ios_Fmtflags)
the code is this:
myTCPSession::myTCPSession(TCPSocket &server) :
TCPSession(NULL, server)
{
std::cout << "creating session client object" << std::endl;
mutex.EnterMutex();
++count;
mutex.LeaveMutex();
unsetf(std::ios::binary);
}
--
Felix Natter