python pycxx first testing case build error

174 Views Asked by At

trying to use pycxx.

using: python 3.5 64-bit, windows 7 64-bit, pycxx 6.2.8

have written a simple cxx file to test out.

but the build had error, tried to search the solution but failed

aaa.cxx as:

#include "CXX/Objects.hxx"

Py::List haha(Py::List a)
{
    a.append(Py::Long(100));
    return a;
}

setup.py as:

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')
                         ],
            )
       ]
)

using "python setup.py install" to build, but with error: build error

thank you very much for the help in advance.

0

There are 0 best solutions below