On Tue, Sep 05, 2006 at 02:09:25PM +0200, Georg Baum wrote:

> Enrico Forestieri wrote:
> 
> > Georg, I tried your test program on cygwin and, after adding an
> > "#include <iconv.h>" line, it fails to compile as follows:
> > 
> > $ g++ stream2.cpp -o stream2
> > stream2.cpp: In function `int main()':
> > stream2.cpp:230: error: `wcerr' is not a member of `std'
> > stream2.cpp:238: error: `wcerr' is not a member of `std'
> > stream2.cpp:241: error: `wcerr' is not a member of `std'
> > stream2.cpp:244: error: `wcerr' is not a member of `std'
> > 
> > This seems to be a cygwin problem and I have no idea how to solve it.
> 
> std::wcerr should be declared in iostream. If gcc on cygwin does not have it
> then it is not standard conforming.

This is a problem common to both mingw and cygwin. They do not
support wide character I/O.

To overcome it, I tried installing STLport but your test case fails
to compile because the codecvt class is already defined in the _codecvt.h
STLport header. This is what I get:

$ g++ -I/usr/local/include/stlport stream2.cpp -o stream2 -liconv 
-L/usr/local/lib -lstlport
stream2.cpp:20: error: expected template-name before '<' token
stream2.cpp:20: error: expected `{' before '<' token
stream2.cpp:20: error: expected unqualified-id before '<' token
stream2.cpp:20: error: expected `;' before '<' token
stream2.cpp:65: error: invalid use of undefined type `class 
stlpmtx_std::codecvt<boost::uint32_t, char, mbstate_t>'
/usr/local/include/stlport/stl/_codecvt.h:46: error: declaration of `class 
stlpmtx_std::codecvt<boost::uint32_t, char, mbstate_t>'
stream2.cpp:78: error: invalid use of undefined type `class 
stlpmtx_std::codecvt<boost::uint32_t, char, mbstate_t>'
/usr/local/include/stlport/stl/_codecvt.h:46: error: declaration of `class 
stlpmtx_std::codecvt<boost::uint32_t, char, mbstate_t>'
[tons of other errors]


Placing an "#if 0/#endif" around the codecvt class definition in
stream2.cpp doesn't work either:

$ g++ -I/usr/local/include/stlport stream2.cpp -o stream2 -liconv 
-L/usr/local/lib -lstlport
stream2.cpp:67: error: too few template-parameter-lists
/usr/local/include/stlport/stl/_ios.c: In member function `stlpmtx_std::locale 
stlpmtx_std::basic_ios<_CharT, _Traits>::imbue(const stlpmtx_std::locale&) 
[with _CharT = lyx::char_type, _Traits = 
stlpmtx_std::char_traits<lyx::char_type>]':
stream2.cpp:228:   instantiated from here
/usr/local/include/stlport/stl/_ios.c:75: error: `id' is not a member of 
`stlpmtx_std::ctype<lyx::char_type>'
stream2.cpp:228:   instantiated from here
/usr/local/include/stlport/stl/_ios.c:76: error: `id' is not a member of 
`stlpmtx_std::numpunct<lyx::char_type>'
/usr/local/include/stlport/stl/_ios.c:77: error: 'class 
stlpmtx_std::numpunct<lyx::char_type>' has no member named 'grouping'
/usr/local/include/stlport/stl/_ios.h: In member function `_CharT 
stlpmtx_std::basic_ios<_CharT, _Traits>::widen(char) const [with _CharT = 
lyx::char_type, _Traits = stlpmtx_std::char_traits<lyx::char_type>]':
/usr/local/include/stlport/stl/_ios.c:108:   instantiated from `void 
stlpmtx_std::basic_ios<_CharT, 
_Traits>::init(stlpmtx_std::basic_streambuf<_CharT, _Traits>*) [with _CharT = 
lyx::char_type, _Traits = stlpmtx_std::char_traits<lyx::char_type>]'
/usr/local/include/stlport/stl/_fstream.h:581:   instantiated from 
`stlpmtx_std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = 
lyx::char_type, _Traits = stlpmtx_std::char_traits<lyx::char_type>]'
stream2.cpp:227:   instantiated from here
/usr/local/include/stlport/stl/_ios.h:142: error: invalid static_cast from type 
`const stlpmtx_std::locale::facet*' to type `const 
stlpmtx_std::ctype<lyx::char_type>*'
[tons of other errors]

Sigh.

-- 
Enrico

Reply via email to