This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problems porting Common-C++


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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]