2

I need to compile a C++ project in Xcode 7.2 (clang++ compiler) using C++11 dialect (-std=c++11 option), but using libstdc++ (GNU C++ standard library) which doesn't have all C++11 definitions/declarations.

Some third party library include header checks for C++11 feature cxx_unicode_literals which is not available using: __has_feature(cxx_unicode_literals)

Is there a way to pass a compiler option which will disable cxx_unicode_literals feature so I don't need to recompile third party library?

cbuchart
  • 10,847
  • 9
  • 53
  • 93
Lisur
  • 149
  • 1
  • 12
  • `__has_feature` seems to be a clang extension. – Olaf Dietsche Apr 26 '17 at 06:53
  • Sorry, I forgot to mention compiler I am using. However, I mentioned in keywords clang++. Thanks – Lisur Apr 26 '17 at 07:04
  • I might be missing something here, but how are Unicode _literals_ a problem for `libstdc++`? Such literals would be a compiler feature. – MSalters Apr 26 '17 at 08:56
  • Xcode 7.2 has two main options to control c++11 features: one for selecting C++ dialect, and other for selecting C++ stdlib. So if you select C++11 dialect, you can use all C++11 compiler features, but it doesn't mean they are implemented c++ stdlib you selected. This is done very badly in Xcode and many third party libraries have problems with that (e.g., Qt). In my situation one library is built with one stdlib, and other with second stdlib so I get linker errors unless I recompile both libraries from source to use the same stdlib. – Lisur Apr 26 '17 at 09:20

0 Answers0