Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #9108

Re: std::locale problem on Mac OSX

From Vaclav Zeman <vzeman79@sh.cvut.cz>
Newsgroups comp.lang.c++
Subject Re: std::locale problem on Mac OSX
Date 2011-08-20 12:35 +0200
Organization Czech Technical University
Message-ID <4E4F8DF7.60907@sh.cvut.cz> (permalink)
References <90f58b01-b19c-4c50-90e0-af3a84822fb0@h14g2000yqd.googlegroups.com>

Show all headers | View raw


meskio wrote, On 18.8.2011 0:07:
> I get a runtime_error while porting a program to Mac OSX 10.6 with
> std::locale.
> 
> #include <locale>
> int main ( int argc, char *argv [] ) {
>     std::locale mylocale("");
>     return 0;
> }
> 
> Returns an error for any locale diferent than "C":
> bash-3.2$ LANG=es_ES.UTF-8 ./locale
> terminate called after throwing an instance of 'std::runtime_error'
>   what():  locale::facet::_S_create_c_locale name not valid
> Abort trap
This happens when GCC is not configured with locale support. See
<http://gcc.gnu.org/onlinedocs/libstdc++/manual/configure.html>, the
--enable-clocale option.

> 
> 
> Is that a Mac OSX bug? Am I doing something wrong?
It might be that MacOS X does not support what GNU libstdc++ needs/wants to
implement fully functional std::locale. I cannot tell as I do not use that OS.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

std::locale problem on Mac OSX meskio <meskio@gmail.com> - 2011-08-17 15:07 -0700
  Re: std::locale problem on Mac OSX "Alf P. Steinbach" <alf.p.steinbach:usenet@gmail.com> - 2011-08-18 03:23 +0200
    Re: std::locale problem on Mac OSX Nobody <nobody@nowhere.com> - 2011-08-18 18:44 +0100
  Re: std::locale problem on Mac OSX Vaclav Zeman <vzeman79@sh.cvut.cz> - 2011-08-20 12:35 +0200

csiph-web