This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC with Solaris -- using std::locale crashes


Hi,

I am currently using GCC 4.4.4 on my Solaris machine and I am having a
difficult time getting it to compile with "locale-support".

For example, if I build the simple file:

#include <iostream>

int main()
{
  std::cout.imbue(std::locale("en_US.UTF-8"));
  return 0;
}

and run it, it will throw a runtime exception -- "std::runtime_error:
locale::facet::_S_create_c_locale name not valid"

I've stepped through the GCC code and I notice that there is code in
c++locale.cc (libstdc++v3 folder) that looks something like this:

If (locale being used is NOT “C” and NOT “POSIX”)
{
   throw std::runtime_error(“locale::facet::_S_create name not valid”);
}

So, I am guessing that the problem here, is that GCC is not build with
"locale-support" and therefore, I am only allowed to use "C" and
"POSIX" locales.  Is this correct?  Also, I am guessing if that if I
rebuild GCC to support locales, that I can use locales other than "C"
or "POSIX" on Solaris.

I tried rebuilding GCC 4.4.4 with the flag "--enable-clocale=gnu" and
it still crashed in the same location.  I also tried building GCC with
the flag "--enable-clocale=ieee_1003.1-2001", and this time, it didn't
even build.

So, I was wondering if there is something that I haven't tried that
someone can suggest?  I'd like to build GCC so that I can use UTF-8
locales.

Thanks,
J


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]