lexical_cast.hpp:102: error: `wstring' is not a member of `std' ?

Hello, I'm not a boost expert, but I'm using LyX, which has boost (version 1.31.0) included in its source code. I have FreeBSD (4.10) and use gcc 3.4.2. When I compile LyX, I get an error from boost: [...] ../../boost/boost/lexical_cast.hpp:102: error: `wstring' is not a member of `std' ../../boost/boost/lexical_cast.hpp:102: error: `wstring' is not a member of `std' ../../boost/boost/lexical_cast.hpp:103: error: template argument 1 is invalid ../../boost/boost/lexical_cast.hpp:103: error: explicit specialization of non-template `<type error>' ../../boost/boost/lexical_cast.hpp:162: error: declaration of `operator>>' as non-function ../../boost/boost/lexical_cast.hpp:162: error: expected `;' before '(' token ../../boost/boost/lexical_cast.hpp:168: error: expected `;' before "private" When I reported this to the LyX list, I was told to forward the problem to the boost list. There may be a problem here with FreeBSD, gcc 3.4.2 and boost. Any idea what is going on here? Thanks, Rob.

On Mon, Sep 27, 2004 at 01:17:12PM +0900, Rob wrote:
Hello,
I'm not a boost expert, but I'm using LyX, which has boost (version 1.31.0) included in its source code.
I have FreeBSD (4.10) and use gcc 3.4.2. When I compile LyX, I get an error from boost:
[...] ../../boost/boost/lexical_cast.hpp:102: error: `wstring' is not a member of `std' ../../boost/boost/lexical_cast.hpp:102: error: `wstring' is not a member of `std' ../../boost/boost/lexical_cast.hpp:103: error: template argument 1 is invalid ../../boost/boost/lexical_cast.hpp:103: error: explicit specialization of non-template `<type error>' ../../boost/boost/lexical_cast.hpp:162: error: declaration of `operator>>' as non-function ../../boost/boost/lexical_cast.hpp:162: error: expected `;' before '(' token ../../boost/boost/lexical_cast.hpp:168: error: expected `;' before "private"
When I reported this to the LyX list, I was told to forward the problem to the boost list. There may be a problem here with FreeBSD, gcc 3.4.2 and boost. Any idea what is going on here?
FreeBSD's wchar_t support is limited, so GCC does not enable any wide-char support in the C++ stdlib All uses of wstring/char_t/wstream etc. are be guarded by BOOST_NO_WSTRING so they aren't compiled on platforms without wchar support in the stdlib. BOOST_NO_WSTRING will get set automatically because the stdlib does not define _GLIBCXX_USE_WCHAR_T on FreeBSD. However, Boost 1.31 was released before GCC 3.4.1, which changed the stdlib macros from _GLIBCPP_blahblah to _GLIBCXX_blahblah and so Boost's config fails to configure correctly for this compiler. You could try taking the boost/config/stdlib/libstdcppv3.hpp header from CVS, but note that there are additional problems with GCC 3.4.x and Boost due to GCC 3.4 unconditionally defining _REENTRANT. See GCC PR 11953 for details. (I've written a summary of this issue, but it's sitting on my hard drive at home somewhere. I need to send it to this list...) In short, you must define either BOOST_DISABLE_THREADS or compile with -pthreads to avoid linker errors from the pthread_xxx functions. Hope that helps, jon -- First they came for the hackers. But I never did anything illegal with my computer, so I didn't speak up. Then they came for the pornographers. But I thought there was too much smut on the Internet anyway, so I didn't speak up. Then they came for the anonymous remailers. But a lot of nasty stuff gets sent from anon.penet.fi, so I didn't speak up. Then they came for the encryption users. But I could never figure out how to work PGP anyway, so I didn't speak up. Then they came for me. And by that time there was no one left to speak up.
participants (2)
-
Jonathan Wakely
-
Rob