From: SourceForge.net <no...@so...> - 2008-12-28 15:08:46
|
Bugs item #664369, was opened at 2003-01-08 14:16 Message generated for change (Settings changed) made by tslettebo You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=664369&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc Group: Known bugs >Status: Closed Resolution: Later Priority: 1 Private: No Submitted By: Terje Sletteb?</td> </tr> <tr (tslettebo) Assigned to: Nobody/Anonymous (nobody) Summary: Missing wide character support in MinGW 3.2? Initial Comment: Hi. I've tried searching the mingw-users mailing list archive, but it appears the search function doesn't work, now, so therefore I'm posting, here. When trying to compile a program that uses std::wstring, I get a link-error about missing definition. std::string works fine, though. I've used MinGW 3.2 that comes with Dev-C++. It appears to be a MinGW related problem, as I've heard from others who had the same problem. Also, when testing for _GLIBCPP_USE_WCHAR_T on MinGW, it's conspicuously absent, and, searching on Google, I found this posting (http://www.geocrawler.com/mail/msg.php3? msg_id=9057201&list=6013) from June, 2002: "wide char streams aren't fully supported yet in new libstdc++.a. I'm working on it." Is this still the case? I've heard that GCC 3.2, with library, now supports wide characters. Regards, Terje ---------------------------------------------------------------------- Comment By: James Bannon (jbannon) Date: 2003-05-01 16:41 Message: Logged In: YES user_id=734384 I logged this as a problem with GNU (see the GNATS web bug #10535 and the history there) before I knew it was a "known" issue under MinGW. Danny is right in saying that the GNU libstdc++ documentation says you need a working GLIBC to support it fully. The same problem is reported under Solaris and HP-UX as well as Cygwin. Just how much C99 support is needed to get it to compile the simple examples I've been using I don't know yet but I will try and find out at least for Cygwin. I will also try a build of GCC 3.2.3 under MinGW to see how I get on. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2003-03-18 22:06 Message: Logged In: YES user_id=11494 Earnie is correct. It needs a lot more work AFAICT, libstdc++ wide char support is currently limited to systems using GLIBC, and just recently, Solaris. libstdc++ really expects POSIX/XPG2 locale functionality. So for starters mingw needs to provide a nl_langinfo-like interface to the w32api NLS functions. Most of the ANSI wide char support is in place, modulo a dependence on msvcp60.dll for restartable mbrtowc family of functions (replacement functions are in my sandbox, but difficult for me to really test far eastern char sets because of lack of time/motivation) There are some hacks that can be done to get wide char support now, but it will only really work for C locale wide chars, so what's the point? Maybe by 3.4. Danny ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-03-18 17:35 Message: Logged In: YES user_id=15438 Well, it needs more work. I.E. Someone needs to implement with a patch to GCC. Earnie. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-03-18 17:29 Message: Logged In: YES user_id=15438 Now the vfwscanf, vswscanf, and vwscanf abort is a bug in cwchar that should have used _GLIBCPP_HAVE_VFWSCANF, _GLIBCPP_HAVE_VSWSCANF and _GLIBCPP_HAVE_VWSCANF to filter their use. Then mingw32/btis/c++config.h can be changed to define _GLIBCPP_USE_WCHAR_T. Earnie. ---------------------------------------------------------------------- Comment By: Steve Lhomme (robux4) Date: 2003-03-18 16:39 Message: Logged In: YES user_id=53329 This very simple example gives the following error : #include <string> int main(int argc, char *argv[]) { std::wstring TestString; return 0; } main.o(.text+0x26):main.cpp: undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string()' main.o(.text+0x35):main.cpp: undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_string()' PS: #define _GLIBCPP_USE_WCHAR_T 1 add the following errors : g++.exe -c main.cpp -o main.o -I"D:/DEV-CPP/include" -I"D:/DEV-CPP/include/c++" -I"D:/DEV-CPP/include" -I"D:/Dev-Cpp/include/c++/mingw32" In file included from D:/DEV-CPP/include/c++/bits/fpos.h:45, from D:/DEV-CPP/include/c++/bits/char_traits.h:46, from D:/DEV-CPP/include/c++/string:47, from main.cpp:2: D:/DEV-CPP/include/c++/cwchar:157: `vfwscanf' not declared D:/DEV-CPP/include/c++/cwchar:159: `vswscanf' not declared D:/DEV-CPP/include/c++/cwchar:161: `vwscanf' not declared ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-03-18 15:57 Message: Logged In: YES user_id=15438 Perhaps this will resolve the issue #define _GLIBCPP_USE_WCHAR_T 1 #include <string> Earnie. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2003-03-18 15:51 Message: Logged In: YES user_id=15438 None of you give a small example. Where's the example? Earnie. ---------------------------------------------------------------------- Comment By: Nigel Stewart (nigels) Date: 2003-03-18 15:08 Message: Logged In: YES user_id=338692 This problem is also observed in Cygwin. A solution to this would be much appreciated. Regards, Nigel Stewart ---------------------------------------------------------------------- Comment By: Steve Lhomme (robux4) Date: 2003-03-18 14:58 Message: Logged In: YES user_id=53329 I'm having the same problem. This problem also exist in gcc-darwin (used in OSX). But this code works under Linux+GCC 3.2 (Mandrake 9.0). Do you plan to solve it someday ? How is GCC supposed to handle Unicode handling otherwise ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=664369&group_id=2435 |