Re: wide character support
Andreas Beyer <
beyer@...>
2004-06-03 12:24:36 GMT
I had to continue my experiments (with gcc 3.4.0 and the respective c++
package).
Essentially two things are necessary to get full support of wstring:
(A) re-compile libstdc++
(B) bind with -lmsvsp60 (This is documented in "wchar.h" line 285.)
However, there are a number of issues:
Re-compiling libstdc++ required that I had to move all configure files
from the gcc source directory one directory upwards before I could run
configure in the libstdc++ sub-directory. (I.e. I had to copy files like
install-sh from gcc-3.4.0-20040501-1/ to gcc-3.4.0-20040501-1/..)
I think this is a bug in libstdc++'s configure script.
Also, link order is important when using this newly compiled libtdc++.
The attached example does *not* link if compiled as:
$ g++ -Wall wctest.cpp -lmsvcp60 # -> linker error
Instead the following works:
$ g++ -Wall wctest.cpp -lstdc++ -lmsvcp60
(Though, in this case you could also use gcc instead of g++.)
I don't see why there is no default support of wstring in mingw's
libstdc++. It only has to be ensured that msvcp60 gets linked before
libstdc++ and then everything works fine (at least with gcc 3.4.0). I
suggest that future bin-packages of libstdc++ are compiled with wstring
support and to change mingw32-g++ settings, such that it links msvcp60
before libstdc++. This should provide at least basic support for
wstring. I haven't tested all possible situations, but the attached
example uses a few basic features that work fine.
(Continue reading)