From: "L. Nicoara" <nicoara at roguewave dot com>
To: Christina Wang <cxwang_wt at hotmail dot com>
Subject: Re: wstring in gcc3.2
Date: Thu, 06 Mar 2003 13:02:29 -0700
Everyone on gcc mailing list seems to think this is normal but is not.
The config process is broken for Solaris and possibly for FreeBSD too.
There is a workaround to this (GLIBCPP_CHECK_WCHAR_T_SUPPORT is an
autoconf macro):
Note: the configuration of the GCC C++ standard library on Solaris
platforms is broken; the GLIBCPP_CHECK_WCHAR_T_SUPPORT macro
tests for the presence of a number of wide char C library
functions, among others it checks for wcstof, which is not
present in Sun/Solaris C library. Because of its lack it
concludes it does not have enough support in the C library to
build the wide char portion of the C++ standard library. This
bug is already documented.
To work around it, the configuration and build process for GCC
can be tweaked easily:
- download, build and install on your system GNU autoconf 2.13
and automake 1.4 (a must!).
- before configuring GCC go to libstdc++-v3 subdirectory and
edit the file acinclude.m4, eliminating from it the only
occurrence of wcstof (in GLIBCPP_CHECK_WCHAR_SUPPORT).
- re-generate the configure script in this directory by running
aclocal, autoconf, autoheader and automake (in this order).
- configure GCC according to the documentation (thread support,
installation directory, etc.).
- start the build. At some point during the building of the C++
standard library it will fail because of missing prototypes
for iswblank and wcstof C99 functions. Go ahead and edit the
two config.h files present in the directory where you did the
build. If that directory is named gcc-obj then the files
relative location is:
<gcc-obj>/sparc-sun-solaris2.9/libstdc++-v3/config.h and
<gcc-obj>/sparc-sun-solaris2.9/sparcv9/libstdc++-v3/config.h
Add in each of the two files the following two declarations:
float wcstof();
int iswblank();
- re-start the build by launching make again.
- after the compiler and the library are built, install according
to the documentation.
Just bug me back if you have any problem. You should end up with a
healthy library.
Liviu
Christina Wang wrote:
>
> Hi,
>
> I posted the following question to gcc-help but nobody replied. Does
anybody
> on this mailing list have the answer? Thank you!
>
>>
>>I got some problems with libstdc++ which is bundled with gcc3.2 on
>>Solaris8.It seems that gcc3.2 doesn't fully support wstring on solaris.
The
>>configuration file of gcc checks some wchar functions that are not
>>supported by the native libc on Solaris 8, then it turns off the wchar
>>support. I changed the configuration file to delete the excessive wchar
>>function checks. And then I could
>>build gcc3.2 with the wstring support. However, after this change, I
cannot
>>link my appliction with the static version of libstdc++ using this
>>compiler. The compiler crashed at the linking stage. The shared version
of
>>libstdc++ still works well. Does anybody know how to enable the wchar
>>support for gcc3.2 on Solaris8 without introducing this kind of side
>>effect?
>>
>>Thanks for any advice!
>>
>>Christina
>>
>>
>>
>>_________________________________________________________________
>>Tired of spam? Get advanced junk mail protection with MSN 8.
>>http://join.msn.com/?page=features/junkmail
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>