正在尝试使用pycxx。你知道吗
使用: python 3.5 64位、windows 7 64位、pycxx 6.2.8
编写了一个简单的cxx文件进行测试。你知道吗
但生成出错,尝试搜索解决方案,但失败
你知道吗aaa.cxx文件作为:
#include "CXX/Objects.hxx"
Py::List haha(Py::List a)
{
a.append(Py::Long(100));
return a;
}
你知道吗设置.py作为:
import os, sys
from distutils.core import setup, Extension
support_dir = os.path.normpath(
os.path.join(
sys.prefix,
'share',
'python%d.%d' % (sys.version_info[0],sys.version_info[1]),
'CXX') )
if os.name == 'posix':
CXX_libraries = ['stdc++','m']
else:
CXX_libraries = []
setup (name = 'aaa',
ext_modules = [
Extension('CXX.aaa',
sources = ['aaa.cxx',
os.path.join(support_dir,'cxxsupport.cxx'),
os.path.join(support_dir,'cxx_extensions.cxx'),
os.path.join(support_dir,'IndirectPythonInterface.cxx'),
os.path.join(support_dir,'cxxextensions.c')
],
)
]
)
使用“python设置.py安装“以生成,但出现错误: build error
非常感谢你事先的帮助。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐