CFLAG -std=c++11 required for linux
Created by: mjansche
When compiling against ICU 60.2 on GNU/Linux, I ran into problems that are easily fixed by adding -std=c++11 to CFLAGS in setup.py
:
CFLAGS = {
'darwin': ['-DPYICU_VER="%s"' %(VERSION)],
- 'linux': ['-DPYICU_VER="%s"' %(VERSION)],
+ 'linux': ['-DPYICU_VER="%s"' %(VERSION), '-std=c++11'],
I suspect the same will be required for darwin. One of several reasons is that the C++ type char16_t
referenced by recent version of ICU (>=58?) only exists in the standard from C++11 onwards.
You could try to set -std=c++11
conditionally depending on the underlying ICU version. In that case, ideally you would get that flag via icu-config --cxxflags
, but icu-config
unfortunately does not provide that. So if you don't want to set -std=c++11
unconditionally, you'll have to add the required check of ICU_VERSION to setup.py.