This is the mail archive of the
mailing list for the Cygwin project.
Re: c++0x and locale_t
On 10/1/2016 10:58 AM, Brian Inglis wrote:
On 2016-10-01 07:30, Ken Brown wrote:
I'm having an issue building icu, which boils down to the following
$ cat foo.cc
$ g++ -c --std=c++0x foo.cc
foo.cc:2:1: error: ‘locale_t’ does not name a type
If I remove '--std=c++0x', the error goes away. I know nothing about
C++ standards, so I don't know if this is expected behavior or if it
indicates a bug in Cygwin's headers.
For C POSIX locale_t support, you have to do one or both of:
#define _XOPEN_SOURCE 700
#define _POSIX_C_SOURCE 200809L
to support multiple dynamic C locales and related functions.
This may be done automatically if you use the default -std=gnu++03,
have been the intent in ICU and original interpretation by g++.
g++ now interprets (and deprecates) c++0x to mean c++11.
You could try changing it to explicitly c++03 and see if it works,
Otherwise you should change it to explicitly gnu++03, as c++0x is
and may be dropped; g++ also deprecates c++1y aka c++14 and c++1z which
c++17, and their gnu++ counterparts.
I don't understand why ICU C++ would use C locales, when C is now trying
a subset of features C++ has supported better, more flexibly in <locale>
over a decade; see:
for a similar problem to yours, and the solution in standard C++; and:
for an explanation of the differences between C++ and C locales.
OTOH ICU comes from IBM, and may be more interested in consistency across
languages: how else can you explain C++ methods called createInstance?
But you may just be the packager, porter, and builder, so may be unable
Thanks for the information. I've submitted a patch upstream.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple