Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

CFLAG -std=c++11 required for linux #65

Closed
mjansche opened this issue Jan 9, 2018 · 2 comments
Closed

CFLAG -std=c++11 required for linux #65

mjansche opened this issue Jan 9, 2018 · 2 comments

Comments

@mjansche
Copy link
Contributor

mjansche commented Jan 9, 2018

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.

@ovalhub
Copy link
Owner

ovalhub commented Jan 9, 2018 via email

@ovalhub
Copy link
Owner

ovalhub commented Jan 9, 2018

However, including -std=c++11 in the defaults might break builds with older ICUs.
Thus closing as "won't fix" since icu-config is supposed to mitigate this mess.

@ovalhub ovalhub closed this as completed Jan 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants