#255 Missing wide character support in MinGW 3.2?

OTHER
closed
nobody
gcc (462)
none
Known_bugs
2013-01-24
2003-01-08
No

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

Discussion

  • Steve Lhomme
    Steve Lhomme
    2003-03-18

    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 ?

     
  • Nigel Stewart
    Nigel Stewart
    2003-03-18

    Logged In: YES
    user_id=338692

    This problem is also observed in Cygwin.
    A solution to this would be much appreciated.

    Regards,

    Nigel Stewart

     
  • Earnie Boyd
    Earnie Boyd
    2003-03-18

    Logged In: YES
    user_id=15438

    None of you give a small example. Where's the example?

    Earnie.

     
  • Earnie Boyd
    Earnie Boyd
    2003-03-18

    Logged In: YES
    user_id=15438

    Perhaps this will resolve the issue

    #define _GLIBCPP_USE_WCHAR_T 1
    #include <string>

    Earnie.

     
  • Steve Lhomme
    Steve Lhomme
    2003-03-18

    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

     
  • Earnie Boyd
    Earnie Boyd
    2003-03-18

    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.

     
  • Earnie Boyd
    Earnie Boyd
    2003-03-18

    Logged In: YES
    user_id=15438

    Well, it needs more work. I.E. Someone needs to implement
    with a patch to GCC.

    Earnie.

     
  • Earnie Boyd
    Earnie Boyd
    2003-03-18

    • status: open --> pending-later
     
  • Danny Smith
    Danny Smith
    2003-03-18

    • status: pending-later --> open-later
     
  • Danny Smith
    Danny Smith
    2003-03-18

    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

     
  • James Bannon
    James Bannon
    2003-05-01

    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.

     
  • Earnie Boyd
    Earnie Boyd
    2004-02-14

    • labels: 456608 --> gcc
    • priority: 5 --> 1
    • assigned_to: earnie --> nobody
     
    • status: open-later --> closed-later
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-24

    • status: closed-later --> closed
    • resolution: --> none
    • category: --> Known_bugs
    • milestone: Known_bugs --> OTHER