On Solaris 8, std::wstring is not available, because libstdc++/aclocal.m4 checks for too many functions The following functions are not available on Solaris. They are required to enable wide strings in libstdc++, but they aren't used by the implementation: vwscanf vfwscanf vswscanf wcstof Notice that support for these functions is only mandated by ISO C99, not by ISO C++. Release: 3.0.2 20011014 (prerelease) Environment: System: SunOS paros 5.8 Generic_108528-08 sun4u sparc SUNW,Sun-Blade-1000 Architecture: sun4 host: sparc-sun-solaris2.8 build: sparc-sun-solaris2.8 target: sparc-sun-solaris2.8 configured with: ../configure --enable-shared --enable-threads --with-cpu=v8 --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs How-To-Repeat: Try compiling #include <string> int main(){ std::wstring s; } This gives a.cc:3: `wstring' undeclared in namespace `std'
Fix: Separately check for these functions in aclocal.m4. If available, export them in include/c_std/bits/std_cwchar.h. In addition, Solaris 8 introducs a #define for wcsftime to __wcsftime_xpg5, and of wcstok to __wcstok_xpg5, unless _XOPEN_VERSION is 4 or #pragma redefine_extname is supported; so re-exporting those functions should happen carefully. Finally, std_cwctype.h re-exports iswblank, even though aclocal.m4 didn't test for it, nor is it supported C99.
From: richard.mouli@axa.be To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, loewis@informatik.hu-berlin.de, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, phil@jaj.com Cc: Subject: Re: libstdc++/4764: std::wstring missing on Solaris Date: Mon, 9 Sep 2002 14:22:21 +0200 <http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view audit-trail&database=gcc&pr=4764> It seems to also aply to the platform i686-pc-cygwin (reported by gcc-3.2/config.guess). Please what is the current bug status? Thanks Richard
State-Changed-From-To: open->analyzed State-Changed-Why: I can reproduce this with 3.0. With 3.2 I now get linker errors: atlas2/wolf> /data/user/software/sparc-sun-solaris2.7/gcc-3.2.0/bin/c++ x.cc Undefined first referenced symbol in file std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string[in-charge]()/var/tmp//ccxuKT4M.o std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_string [in-charge]()/var/tmp//ccxuKT4M.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status
This is a known issue. It would be great to fix it for 3.4, but somebody with a solaris box is going to have to take the lead.
Another dup of bug 6702 hopefully someone will look at this soon. *** This bug has been marked as a duplicate of 6702 ***