const char* hi = "hi"; // ok
const char* hi2 = u8"hi"; // compile error
It causes
error: use of undeclared identifier 'u8'
My compiler supports C++ 11.
~/Project/cpp c++ -v
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
Your compiler doesn't default to C++11 though.
[9:46pm][wlynch@watermelon /tmp] c++ -c blah.cc
blah.cc:2:19: error: use of undeclared identifier 'u8'
const char* hi2 = u8"hi"; // compile error
^
blah.cc:2:21: error: expected ';' after top level declarator
const char* hi2 = u8"hi"; // compile error
^
;
2 errors generated.
[9:47pm][wlynch@watermelon /tmp] c++ -c -std=c++11 blah.cc
[9:47pm][wlynch@watermelon /tmp]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With