2

I'm having a problem using #include <cuchar> in my C++ program. When I use that line, I get the error

Lexical or Preprocessor Error 'cuchar' file not found.

I've tried setting my project to GNU C++ 11, C++ 11, GNU C++ 14, and C++ 14. Any advice would be appreciated.

EDIT: The entirety of my code is as follows:

#include <iostream>
#include <cuchar>

using namespace std;

int main() {
char16_t pirate = u'\u00AE';
cout << pirate;
return 0;
}

As to the compiler, I believe that it is mentioned above that I used GNU C++ 11, GNU C++ 14, C++ 11, and C++ 14.

Luthelis
  • 264
  • 2
  • 9
  • Xcode 6.3 is an IDE, not a compiler. What compiler and version are you using? – Praetorian Apr 14 '15 at 23:46
  • This is waaaaaaaaay too ambiguous. Care to elaborate a bit? – The name's Bob. MS Bob. Apr 15 '15 at 00:05
  • As to the ambiguity, I wish I could. This is the entirety of my code thus far... – Luthelis Apr 15 '15 at 00:18
  • I edited the original post to include my entire code written thus far. Also I restated which compilers I used, C++ 14, C++ 11, GNU C++ 14, and GNU C++ 11. – Luthelis Apr 15 '15 at 00:25
  • 1
    FYI, in C++11, you don't need to include `cuchar` in order to use `char16_t`. – kirbyfan64sos Apr 15 '15 at 16:36
  • Also, what version of OSX do you have? Leopard (10.5) [doesn't seem to have this header](https://www.gnu.org/software/gnulib/manual/html_node/uchar_002eh.html). – kirbyfan64sos Apr 15 '15 at 16:38
  • I know that libstdc++ (gnuC++ 1*) is missing cuchar. I'm going to see what to do to add it FWIW. Basically, cuchar is going to include uchar.h. Most recent versions of glibc have this. This header just declares some free functions to convert between char[16][32]_t and multibyte char sequences. You can use char[16][32]_t without it as others have noted. – emsr Apr 16 '15 at 00:46

0 Answers0