compiling boost shmem-0.93 on winxp with mingw-3.4.2
To the Boost-User community, I'm not sure if this is the right forum for this type of question so I'll probably take heat for posting this problem here...in any case, I've been having some build errors working with boost shmem-0.93 on winxp using mingw-3.4.2. Documentation states that shmem should compile on this platform but, I've discovered an interesting error with char_traits. In all shmem streams, I have problems with the type referencing of post_type - I'm getting this error: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' Below is the gcc output of my build error. Any help with this is greatly appreciated! Chris Taylor gcc ../../test/bufferstream_test.cpp -I/C/MinGW/include/boost-1_33_1 -L/C/MinGW/ libs -Wall -L-I/C/MinGW/include -L/C/MinGW/libs -lboost_thread-gcc-mt -I../../. ./.. -lstdc++ -o ../../bin/mingw/test_bufferstream_test.out c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/streambuf: I n instantiation of `std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >': ../../../../boost/shmem/streams/bufferstream.hpp:56: instantiated from `boost: :shmem::basic_bufferbuf<wchar_t, std::char_traits<wchar_t> >' ../../test/bufferstream_test.cpp:9: instantiated from here c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/streambuf:13 5: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/streambuf:23 4: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/streambuf:23 9: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/streambuf:57 4: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/streambuf:58 6: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' ../../../../boost/shmem/streams/bufferstream.hpp: In instantiation of `boost::sh mem::basic_bufferbuf<wchar_t, std::char_traits<wchar_t> >': ../../test/bufferstream_test.cpp:9: instantiated from here ../../../../boost/shmem/streams/bufferstream.hpp:60: error: no type named `pos_t ype' in `struct std::char_traits<wchar_t>' ../../../../boost/shmem/streams/bufferstream.hpp:236: error: no type named `pos_ type' in `struct std::char_traits<wchar_t>' ../../../../boost/shmem/streams/bufferstream.hpp:301: error: no type named `pos_ type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_i os.h: In instantiation of `std::basic_ios<wchar_t, std::char_traits<wchar_t> >': c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream:60: instantiated from `std::basic_istream<wchar_t, std::char_traits<wchar_t> >' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream:706: instantiated from `std::basic_iostream<wchar_t, std::char_traits<wchar_t> >' ../../../../boost/shmem/streams/bufferstream.hpp:443: instantiated from `boost ::shmem::basic_bufferstream<wchar_t, std::char_traits<wchar_t> >' ../../test/bufferstream_test.cpp:11: instantiated from here c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/basic_i os.h:67: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream: In instantiation of `std::basic_istream<wchar_t, std::char_traits<wchar_t> >': c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream:706: instantiated from `std::basic_iostream<wchar_t, std::char_traits<wchar_t> >' ../../../../boost/shmem/streams/bufferstream.hpp:443: instantiated from `boost ::shmem::basic_bufferstream<wchar_t, std::char_traits<wchar_t> >' ../../test/bufferstream_test.cpp:11: instantiated from here c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream:65: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/istream .tcc:847: error: no type named `pos_type' in `class std::basic_istream<wchar_t, std::char_traits<wchar_t> >' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/istream .tcc:865: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream: In instantiation of `std::basic_ostream<wchar_t, std::char_traits<wchar_t> >': c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream:706: instantiated from `std::basic_iostream<wchar_t, std::char_traits<wchar_t> >' ../../../../boost/shmem/streams/bufferstream.hpp:443: instantiated from `boost ::shmem::basic_bufferstream<wchar_t, std::char_traits<wchar_t> >' ../../test/bufferstream_test.cpp:11: instantiated from here c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/ostream:64: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream .tcc:404: error: no type named `pos_type' in `class std::basic_ostream<wchar_t, std::char_traits<wchar_t> >' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ostream .tcc:420: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream: In instantiation of `std::basic_iostream<wchar_t, std::char_traits<wchar_t> >': ../../../../boost/shmem/streams/bufferstream.hpp:443: instantiated from `boost ::shmem::basic_bufferstream<wchar_t, std::char_traits<wchar_t> >' ../../test/bufferstream_test.cpp:11: instantiated from here c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/istream:713: error: no type named `pos_type' in `struct std::char_traits<wchar_t>' ../../../../boost/shmem/streams/bufferstream.hpp: In instantiation of `boost::sh mem::basic_bufferstream<wchar_t, std::char_traits<wchar_t> >': ../../test/bufferstream_test.cpp:11: instantiated from here ../../../../boost/shmem/streams/bufferstream.hpp:448: error: no type named `pos_ type' in `class std::basic_ios<wchar_t, std::char_traits<wchar_t> >' ../../../../boost/shmem/streams/bufferstream.hpp: In instantiation of `boost::sh mem::basic_ibufferstream<wchar_t, std::char_traits<wchar_t> >': ../../test/bufferstream_test.cpp:13: instantiated from here ../../../../boost/shmem/streams/bufferstream.hpp:342: error: no type named `pos_ type' in `class std::basic_ios<wchar_t, std::char_traits<wchar_t> >' ../../../../boost/shmem/streams/bufferstream.hpp: In instantiation of `boost::sh mem::basic_obufferstream<wchar_t, std::char_traits<wchar_t> >': ../../test/bufferstream_test.cpp:15: instantiated from here ../../../../boost/shmem/streams/bufferstream.hpp:394: error: no type named `pos_ type' in `class std::basic_ios<wchar_t, std::char_traits<wchar_t> >' make: *** [../../bin/mingw/test_bufferstream_test.out] Error 1
Hi Chris,
Documentation states that shmem should compile on this platform but, I've discovered an interesting error with char_traits. In all shmem streams, I have problems with the type referencing of post_type - I'm getting this error:
error: no type named `pos_type' in `struct std::char_traits<wchar_t>'
Below is the gcc output of my build error. Any help with this is greatly appreciated!
This error is familiar. I had it when doing the tests and I found that char_traits was defined for gcc: #if defined (_GLIBCXX_USE_WCHAR_T) || defined (_GLIBCXX_USE_WSTRING) /// 21.1.3.2 char_traits specializations template<> struct char_traits<wchar_t> { typedef wchar_t char_type; typedef wint_t int_type; typedef streamoff off_type; #if defined (_GLIBCXX_USE_WCHAR_T) typedef wstreampos pos_type; typedef mbstate_t state_type; #endif avoids defining pos_type if _GLIBCXX_USE_WCHAR_T is not defined. It seems that mingw defines _GLIBCXX_USE_WSTRING but not _GLIBCXX_USE_WSTRING. Consequence: you can't use wide streams. I modified my local header to pass the tests... and that's why my local tests succeed. The error is produced by the explicit instantiations of bufferstream_test.cpp: //Force instantiations to catch compile-time errors template class basic_bufferbuf<char>; template class basic_bufferbuf<wchar_t>; template class basic_bufferstream<char>; template class basic_bufferstream<wchar_t>; template class basic_ibufferstream<char>; template class basic_ibufferstream<wchar_t>; template class basic_obufferstream<char>; template class basic_obufferstream<wchar_t>; Comment instantiations taking wchar_t parameter to avoid the error. Googling around, I've found that Boost.Iostreams documentation(http://www.boost.org/libs/iostreams/doc/portability.html) marks gcc-mingw 3.2-4.0 as "Wide streams are not supported". So I'm afraid you've found a bug in the Shmem test. Wide stream instantiations should be removed or surrounded by an #ifdef when mingw is being used. Thanks and regards, Ion
Ion Gaztañaga wrote:
afraid you've found a bug in the Shmem test. Wide stream instantiations should be removed or surrounded by an #ifdef when mingw is being used.
I hope you meant to use one of: BOOST_NO_CWCHAR BOOST_NO_CWCTYPE BOOST_NO_STD_WSTREAMBUF BOOST_NO_STD_WSTRING As MinGW can support wide streams, just as long as you use STLport, or some other more complete stdlib implementation than the built in one. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
I hope you meant to use one of:
BOOST_NO_CWCHAR BOOST_NO_CWCTYPE BOOST_NO_STD_WSTREAMBUF BOOST_NO_STD_WSTRING
Thanks.
As MinGW can support wide streams, just as long as you use STLport, or some other more complete stdlib implementation than the built in one.
I've seen that there is no problem with gcc 4.1 also. Thanks for the help. Regards, Ion
participants (3)
-
christopher taylor
-
Ion Gaztañaga
-
Rene Rivera