gcc 3.3.3 stl std::wstring issue

From: Rob Kreger (__rckreger_at_comcast.net)
Date: 09/01/04


Date: Tue, 31 Aug 2004 23:37:20 GMT

I am having an issue trying to use std::wstring on HP UX 11i with gcc
3.3.3. The code snippet below is my test code. When searching
through the code I found the typedef for wstring was conditional
compiled in if _GLIBCPP_USE_WCHAR_T was defined so I defined it and
then I got the error listed below the code snippet.

Any help would be appreciated.
Rob

---- Start Code
#define _GLIBCPP_USE_WCHAR_T 1
#define _GLIBCPP_HAVE_WCHAR_H 1

#include <string>
#include <iostream>

int main (int argc, char *argv[])
{
    std::wstring ltest = L"";

    std::cout << "hello world" << std::endl;
    return(0);
}
-- End Code

Error
VSLICKERRORPATH=/home/kregerre/test3/
SPEHPUX1:/home/kregerre/test3> g++ -c -g -o "Debug/test3.o"
"/home/kregerre/test3/test3.cpp"
In file included from /usr/local/include/c++/3.3.3/bits/fpos.h:45,
                 from
/usr/local/include/c++/3.3.3/bits/char_traits.h:46,
                 from /usr/local/include/c++/3.3.3/string:47,
                 from /home/kregerre/test3/test3.cpp:6:
/usr/local/include/c++/3.3.3/cwchar:137: error: `btowc' not declared
/usr/local/include/c++/3.3.3/cwchar:142: error: `fwide' not declared
/usr/local/include/c++/3.3.3/cwchar:143: error: `fwprintf' not
declared
/usr/local/include/c++/3.3.3/cwchar:144: error: `fwscanf' not declared
/usr/local/include/c++/3.3.3/cwchar:147: error: `mbrlen' not declared
/usr/local/include/c++/3.3.3/cwchar:148: error: `mbrtowc' not declared
/usr/local/include/c++/3.3.3/cwchar:149: error: `mbsinit' not declared
/usr/local/include/c++/3.3.3/cwchar:150: error: `mbsrtowcs' not
declared

subject gcc 3.3.3 stl std::wstring issue



Relevant Pages

  • Re: another gcc-4.2 compile problem on alpha: gameport
    ... I have narrowed it down to the following code snippet. ... Do you have time to simplify the code snippet and persuade the gcc people? ... struct kernel_param { ... static unsigned int psmouse_resolution = 200; ...
    (Linux-Kernel)
  • Incorrect template code, or compiler/library bug?
    ... The code below compiles without warnings or errors under g++ 3.2.1 on ... Solaris, gcc 3.2.2 on Linux, and MSVC 6.0 on Windows. ... int main (int argc, char *argv) ...
    (comp.lang.cpp)
  • Re: Odd behavior with odd code
    ... int main(int argc, char ** argv) ... UTC 2006 (Ubuntu 2.6.17-10.33-386) ... On this box the code above compiles but runs in an infinite loop. ... Maybe a gcc ...
    (comp.lang.c)
  • Re: Trivial
    ... Harry wrote: ... I am having a code snippet whose output is trivial to me.Can anybody ... explain?.I am using gcc to compile the code. ...
    (comp.lang.c)
  • Re: Trivial
    ... Mark Bluemel wrote: ... I am having a code snippet whose output is trivial to me.Can anybody ... explain?.I am using gcc to compile the code. ...
    (comp.lang.c)