Hi
I try to use locale in my Xcode project and receive the message
"terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Program received signal: “SIGABRT”.
Here is the code:
#include <iostream>
#include <locale>
using namespace std;
int main(int argc, const char** argv)
{
Hey JLBorges, I will certainly try Boost.Locale if this is a way out.
BTW, icu is another problem for me - it does not work.
I have icu4c 4_8_1_1 in /usr/local,
boost_1_49_0 libraries, in /usr/local/boost.
I built boost :: regex successfully with bjam saying "-has_icu builds: yes", but then if I add #include"boost/regex/icu.hpp" to file main.cpp and compile,I receive 451 errors beginning with:
/usr/local/boost_1_49_0/boost/regex/icu.hpp:22:28: error: unicode/utypes.h: No such file or directory
/usr/local/boost_1_49_0/boost/regex/icu.hpp:23:27: error: unicode/uchar.h: No such file or directory
etc. etc.
Worse even,if I just put ANY Unicode header file to my main.cpp I got the same error message - "no such file".
So boost :: regex does not see icu and icu all alone would not work either.
Did you have to add search path for icu to your compiler?
Thanks for your help.
p.s. unfortunately clang does not help.
>You need to add -I <icu include directory> to the command line
Got it and put to use. My first experience fine-tuning gcc! In terminal the following works without errors :
"Valery-Osavlyuks-iMac:CHECKUNICODE spaset$ g++ -I/usr/local/include/unicode -L/usr/local main.cpp -o main".
But how to make it part of my Xcode project?
I cannot use it as script because Run Script is a build phase whereas my problem relates to compiling. Just to be sure I tried it - no change.
Also set Header Search Paths and Library Search Paths in Project Build settings -nothing happens.
>Yes, certainly. And also link with the icu library.
Are you talking about Linking in Project/Target Build settings? Other Linker Flags, by any chance?