Languages and Scripting
Showing results for 
Search instead for 
Did you mean: 

std::wstring program using gcc

New Member

std::wstring program using gcc

I am using gcc compiler 3.3.2

I want use std::wstring in my program. I am trying simple "Hello World !" program using std::wstring and std::wcout. I am getting complie time errors related to wchar_t and related functions.
error: `btowc' not declared
there is huge list of similer errors.

I want to know what is the minumum requirement for wide character support.
e.g versions of libc, libstdc++, gcc.

I am using hp 11.00


Re: std::wstring program using gcc

I remember something about wstring issues with g++. It was in CXX-DEV in 2004 with:
CXX-DEV: wstring not defined using g++ 3.4.1
You can subscribe or search the archives with:,1275,,00.html#24

But there is no way to get that support on 11.00 since there is no libc support until 11.11.

And even with g++ 3.4.3 on 11.23, I don't see any support. I try compiling with -D_GLIBCXX_USE_WCHAR_T -D_INCLUDE__STDC_A1_SOURCE and I get a bunch of other errors about mbstate_t and va_list.
Valued Contributor

Re: std::wstring program using gcc

I am not completely sure of the requirements but I got a test program to work on 11.11 with a 4.0.3 GCC compiler. I think the minimum requirements are HP-UX 11.11 or later and GCC 4.0 or later.