Macos 如何在Cython中链接Mac OS框架
如何在Cython中链接Mac OS框架 我失败了Macos 如何在Cython中链接Mac OS框架,macos,clang,cython,cythonize,Macos,Clang,Cython,Cythonize,如何在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++',
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
import os
os.environ['LDFLAGS'] = '-framework CoreFoundation -framework SystemConfiguration'