New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distutils cannot link C++ code with GCC #35025
Comments
It is mandatory to link C++ code against -lstdc++ -lm distutils does not do this in 2.1.1 Here is a setup.py for Python CXX that works around You can get the CXX sources from from distutils.core import setup, Extension
if os.name == 'posix':
CXX_libraries = ['stdc++','m']
else:
CXX_libraries = []
setup(name="pycxx_demo", version="1.0",
ext_modules=
[Extension(
"example",
sources = [
"Demo/example.cxx",
"Demo/python.cxx",
"Demo/range.cxx",
"Demo/rangetest.cxx",
"Src/cxx_extensions.cxx",
"Src/cxxextensions.c",
"Src/cxxsupport.cxx",
"Src/IndirectPythonInterface.cxx" ],
include_dirs = [ ".", "Demo" ],
libraries = CXX_libraries
)
]
) |
Logged In: YES Nobody at PL understands distutils well enough to do this, |
Logged In: YES Is this the same problem as [ bpo-413582 ] g++ must be called for c++ extensions ? Not a rhetorical question, I would like to know! |
Logged In: YES Yes using G++ is another way to solve this. |
Logged In: YES Barry, is this still a problem w/2.2.2? |
Logged In: YES Fixed in bug bpo-413582. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: