i'm trying to compile cc++ v 1.9.3 with stlport 4.5 under msvc++ 6.
I've added stlports include directory to project settings and tried to build. following errors show up:
e:\work\commoncpp\src\socket.h(1443) : error C2008: ':' : unexpected in macro definition
e:\work\commoncpp\src\socket.h(1443) : warning C4005: 'std' : macro redefinition
e:\work\stlport\stlport\stl\_epilog.h(28) : see previous definition of 'std'
e:\work\commoncpp\src\socket.h(1448) : error C2059: syntax error : ':'
e:\work\commoncpp\src\socket.h(1448) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1448) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1531) : error C2226: syntax error : unexpected type 'iostream'
e:\work\commoncpp\src\socket.h(1531) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1532) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
e:\work\commoncpp\src\socket.h(1739) : warning C4091: 'extern __declspec(dllexport ) ' : ignored on left of 'int' when no variable is declared
e:\work\commoncpp\src\socket.h(1739) : error C2143: syntax error : missing ';' before ':'
e:\work\commoncpp\src\socket.h(1739) : error C2059: syntax error : ':'
e:\work\commoncpp\src\socket.h(1739) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1739) : error C2143: syntax error : missing ';' before '&'
e:\work\commoncpp\src\socket.h(1739) : error C2512: 'basic_iostream<char,class _STL::char_traits<char> >' : no appropriate default constructor available
e:\work\commoncpp\src\socket.h(1739) : error C2059: syntax error : ':'
e:\work\commoncpp\src\socket.h(1739) : error C2501: '<<' : missing storage-class or type specifiers
e:\work\commoncpp\src\socket.h(1739) : error C2809: 'operator <<' has no formal parameters
e:\work\commoncpp\src\socket.h(2069) : error C2629: unexpected 'class ost::SockException ('
e:\work\commoncpp\src\socket.h(2069) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
e:\work\commoncpp\src\socket.h(2069) : error C2143: syntax error : missing ')' before '}'
e:\work\commoncpp\src\socket.h(2069) : error C2059: syntax error : ')'
e:\work\commoncpp\src\socket.h(2069) : error C2143: syntax error : missing ')' before '}'
e:\work\commoncpp\src\socket.h(2069) : error C2143: syntax error : missing ';' before '}'
e:\work\commoncpp\src\socket.h(2069) : error C2238: unexpected token(s) preceding ';'
e:\work\commoncpp\src\socket.h(2074) : error C2143: syntax error : missing ';' before '}'
e:\work\commoncpp\src\socket.h(2074) : error C2143: syntax error : missing ';' before '}'
e:\work\commoncpp\src\socket.h(2074) : error C2143: syntax error : missing ';' before '}'
they also show up in digest.h
I've found that std::iostream_withassign is defined in iostream.h, not in iostream, but changing included header doesn't help.
could anyone help me with this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First it appears that the MSVC++ does not allow you to #define a macro with a colon in it's name. So you cannot redefine std::iostream to std::iostream_withassign.
Then it looks like in the stlport 4.5 the iostream_withassign is defined in the <iostream.h> and is in the global namespace not in the std.
So I changed TCPStream declaration to :
#include <iostream.h>
class TCPStream : public Socket, public std::streambuf, public iostream_withassign
{
... then it compiled. But new problem appeared. It was:
e:\work\commoncpp\src\socket.h(1669) : error C2664: '__thiscall _STL::basic_ios<char,class _STL::char_traits<char> >::_STL::basic_ios<char,class _STL::char_traits<char> >(class _STL::basic_streambuf<char,class _STL::char_traits<char> > *)' : cannot convert parameter 1 from 'const class ost::tcpstream' to 'class _STL::basic_streambuf<char,class _STL::char_traits<char> > *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
This bug appeared in every class derived from TCPStream. I found that adding copy constructor to such class helped but I don't know why.
Hope this helps someone besides me.
Borzoj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i'm trying to compile cc++ v 1.9.3 with stlport 4.5 under msvc++ 6.
I've added stlports include directory to project settings and tried to build. following errors show up:
e:\work\commoncpp\src\socket.h(1443) : error C2008: ':' : unexpected in macro definition
e:\work\commoncpp\src\socket.h(1443) : warning C4005: 'std' : macro redefinition
e:\work\stlport\stlport\stl\_epilog.h(28) : see previous definition of 'std'
e:\work\commoncpp\src\socket.h(1448) : error C2059: syntax error : ':'
e:\work\commoncpp\src\socket.h(1448) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1448) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1531) : error C2226: syntax error : unexpected type 'iostream'
e:\work\commoncpp\src\socket.h(1531) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1532) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
e:\work\commoncpp\src\socket.h(1739) : warning C4091: 'extern __declspec(dllexport ) ' : ignored on left of 'int' when no variable is declared
e:\work\commoncpp\src\socket.h(1739) : error C2143: syntax error : missing ';' before ':'
e:\work\commoncpp\src\socket.h(1739) : error C2059: syntax error : ':'
e:\work\commoncpp\src\socket.h(1739) : error C2039: 'iostream_withassign' : is not a member of 'std'
e:\work\commoncpp\src\socket.h(1739) : error C2143: syntax error : missing ';' before '&'
e:\work\commoncpp\src\socket.h(1739) : error C2512: 'basic_iostream<char,class _STL::char_traits<char> >' : no appropriate default constructor available
e:\work\commoncpp\src\socket.h(1739) : error C2059: syntax error : ':'
e:\work\commoncpp\src\socket.h(1739) : error C2501: '<<' : missing storage-class or type specifiers
e:\work\commoncpp\src\socket.h(1739) : error C2809: 'operator <<' has no formal parameters
e:\work\commoncpp\src\socket.h(2069) : error C2629: unexpected 'class ost::SockException ('
e:\work\commoncpp\src\socket.h(2069) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
e:\work\commoncpp\src\socket.h(2069) : error C2143: syntax error : missing ')' before '}'
e:\work\commoncpp\src\socket.h(2069) : error C2059: syntax error : ')'
e:\work\commoncpp\src\socket.h(2069) : error C2143: syntax error : missing ')' before '}'
e:\work\commoncpp\src\socket.h(2069) : error C2143: syntax error : missing ';' before '}'
e:\work\commoncpp\src\socket.h(2069) : error C2238: unexpected token(s) preceding ';'
e:\work\commoncpp\src\socket.h(2074) : error C2143: syntax error : missing ';' before '}'
e:\work\commoncpp\src\socket.h(2074) : error C2143: syntax error : missing ';' before '}'
e:\work\commoncpp\src\socket.h(2074) : error C2143: syntax error : missing ';' before '}'
they also show up in digest.h
I've found that std::iostream_withassign is defined in iostream.h, not in iostream, but changing included header doesn't help.
could anyone help me with this?
I've found an answer on my own.
First it appears that the MSVC++ does not allow you to #define a macro with a colon in it's name. So you cannot redefine std::iostream to std::iostream_withassign.
Then it looks like in the stlport 4.5 the iostream_withassign is defined in the <iostream.h> and is in the global namespace not in the std.
So I changed TCPStream declaration to :
#include <iostream.h>
class TCPStream : public Socket, public std::streambuf, public iostream_withassign
{
... then it compiled. But new problem appeared. It was:
e:\work\commoncpp\src\socket.h(1669) : error C2664: '__thiscall _STL::basic_ios<char,class _STL::char_traits<char> >::_STL::basic_ios<char,class _STL::char_traits<char> >(class _STL::basic_streambuf<char,class _STL::char_traits<char> > *)' : cannot convert parameter 1 from 'const class ost::tcpstream' to 'class _STL::basic_streambuf<char,class _STL::char_traits<char> > *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
This bug appeared in every class derived from TCPStream. I found that adding copy constructor to such class helped but I don't know why.
Hope this helps someone besides me.
Borzoj