libstdc++/10535: No specialisations for wchar_t in std::strin g or std::ostream?
James Bannon
james.bannon@isiuk.com
Wed Apr 30 13:52:00 GMT 2003
From: James Bannon (e-mailed from work, hence the address) Bug ID: 10535. I
don't have update access to GNATS and I have some more information.
I was working a little more on this last night as the thought that I was
doing something wrong was "bugging" me! I extracted the new sources
available under GCC 3.2.3 and had a careful look before running ./configure
i686-pc-cygwin again. I found that there *is* a specialisation for wchar_t
available, but only if you define the macro _GCPPLIB_USE_WCHAR_T (resulting
in the macro C I mentioned being set to wchar_t instead of char apparently).
Ah-ha I thought, try g++ -D_GCPPLIB_USE_WCHAR_T to make the specialisations
available! Doing this, I no longer got the syntax error complaining about
wstring, wcout & friends not being defined in namespace std. However, what I
did get was errors complaining about the "wide" (C99?) variants of the
cstdio functions not being available. Progress of a sort I suppose, although
I still shouldn't have to predefine that macro and I can't find a reference
to it anywhere in the documentation.
On further inspection of the actual downloaded source, I can't find anywhere
where the "wide" variants are injected into the std namespace. The
documentation says I can specify which version of C to use but that this
should *only* affect gcc, not g++. I have checked my INCLUDE path etc to
make sure that /usr/local/include comes first as I have more than one
version installed (the i686-pc-cygwin 2.95 and 3.2 (prerelease) binaries
currently), but this seems to make no difference. I have heard that it works
OK under Redhat Linux but I cannot confirm this.
I am beginning to think I should be defining something in the build
somewhere prior to running the configure script. Should I be defining
_GCPPLIB_USE_WCHAR_T and c99 during the configuration perhaps? I will try
the following:
1. Uninstall Cygwin completely.
2. Download a fresh copy of Cygwin with only one version of the
compiler (3.2) & I will download the sources for checking.
3. Re-install Cygwin.
4. Try looking at running the configure script with
_GCPP_LIB_USE_WCHAR_T and c99 defined.
Best Regards,
James Bannon
More information about the Gcc-bugs
mailing list