如何在 Cython 中链接 Mac OS 框架?
我失败了
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
ext_modules=[
Extension("PyLexActivator",
sources=["PyLexActivator.pyx"],
language='c++',
extra_objects=["libLexActivator.a"],
extra_link_args=['-framework CoreFoundation',
'-framework SystemConfiguration'],
)
]
setup(
name = "PyLexActivator",
ext_modules = cythonize(ext_modules)
)
错误
python setup.py build_ext --inplace
running build_ext
building 'PyLexActivator' extension
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/o/anaconda/include -arch x86_64 -I. -I/Users/o/anaconda/include/python3.5m -c PyLexActivator.cpp -o build/temp.macosx-10.6-x86_64-3.5/PyLexActivator.o
/usr/bin/clang++ -bundle -undefined dynamic_lookup -L/Users/o/anaconda/lib -arch x86_64 build/temp.macosx-10.6-x86_64-3.5/PyLexActivator.o libLexActivator.a -L/Users/o/anaconda/lib -o
/Users/suo/Documents/guanran/face_recommend/cryptlex/PyLexActivator.cpython-35m-darwin.so -framework Foundation -framework SystemConfiguration
clang: error: unknown argument: '-framework CoreFoundation'
clang: error: unknown argument: '-framework SystemConfiguration'
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
error: command '/usr/bin/clang++' failed with exit status 1
将完整路径添加到框架也不起作用。