python - How to specify C++11 with distutils? -


I have a module that should be compiled with C ++ 11. On GCC and Clang, this means the std = c ++ 11 switch on the old compiler, or std = c ++ 0x .

Python is not compiled with this switch, so in the distroits it is not included when compiling the module.

What is the preferred way of compiling the C ++ 11 code with distutils?

your extra_compile_args parameter distutils.core.Extension can:

  ext = extension ('foo', source = [....], libraries = [....], extra_compile_args = ['- std = c ++11 '], ....)   

Note that this platform is completely dependent. It will not work on some older versions of GCC and Ragad.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -