|
Boost Users : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2004-12-08 08:12:53
On Wed, 8 Dec 2004 14:56:5 +0800, zhengyi wrote
> boost-users:
> Here is a new user's letter for help:
>
> when i compile the whole boost(version_1_32_0), it show some
> error of data_time.
>
> the file greg_month.cpp failed. in the lexical_cast.hpp£¬line 126
> string_type s(boost::lexical_cast<string_type>("not-a-
> date-time"));
>
> the compiler said :
> binary '>>' : no operator found which takes a right-hand operand of
> type_put<Config,charT,OutputIterator>::string_type' (or there is no
> acceptable conversion)
>
> When tracing down the error message, I found that
> [[date_names_put::string_type]] actually means [[std::basic_string<charT>]]
> and in file lexical_cast.hpp line 146 -- 168 there are right
> overload of operator>>. Why the compiler complain about can't find
> the wellformed operator?
I believe this to be related to STLport and it's support for wchar_t somehow.
My only real suggestion is to play with the configuration. One thing you
can try is to set BOOST_NO_STD_WSTRING when you try to compile date-time.
That will make sure that date-time doesn't try to use wchar_t. A bit more
drastic would be to set BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS. See
boost/date_time/compiler_config.hpp. There you will see that under certain
conditions we set that
// workaround for errors associated with output for date classes
// modifications and input streaming for time classes.
// Compilers affected are:
// gcc295, msvc (neither with STLPort), any borland
//
#if (((defined(__GNUC__) && (__GNUC__ < 3)) || \
(defined(_MSC_VER) && (_MSC_VER <= 1200)) ) && \
!defined(_STLP_OWN_IOSTREAMS) ) || \
defined(__BORLANDC__)
#define BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS
#endif
It's possible there are times with STLPort that this needs to be set.
> My Compiler is msvc71 and STLport-5.0-0125 was installed with it's
> own iostream.
>
> the cmdline is
>
> bjam "-sVC71_ROOT=D:\Program Files\Microsoft\Microsoft Visual Studio
> .NET 2003\Vc7" "-sSTLPORT_PATH=D:\Program
> Files\Programming_Tools\STLport-5.0-0125\stlport" "-sSTLPORT_5.0-
> 0125_PATH=D:\Program Files\Programming_Tools\STLport-5.0-0125" "-
> sSTLPORT_VERSIONS=5.0-0125" "-sTOOLS=vc-7_1-stlport" "-
> -prefix=D:\Program Files\Programming_Tools\Boost_1_32" install -
> -with-date_time
>
> this problem has killed so many brain cells of mine !
Sorry to hear that :-(
Jeff
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net