Skip to content
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

python setup.py build_ext error #95

Open
pjpan opened this issue Jan 3, 2018 · 0 comments
Open

python setup.py build_ext error #95

pjpan opened this issue Jan 3, 2018 · 0 comments

Comments

@pjpan
Copy link

pjpan commented Jan 3, 2018

env:
linux-centos 6.5
swig:1.3.40
python: 3.6 (anaconda)

when command python setup.py build_ext,raise error. How to fix it

here is details:
[bankdplyop@CNSZ446042 python]$ python setup.py build_ext --include-dir=/bankapp/bankdplyop/packages/crfsuite/include --library-dirs=/bankapp/bankdplyop/packages/crfsuite/lib
running build_ext
building '_crfsuite' extension
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/bankapp/bankdplyop/packages/crfsuite/include -I/bankapp/bankdplyop/anaconda3/include/python3.6m -c crfsuite.cpp -o build/temp.linux-x86_64-3.6/crfsuite.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/bankapp/bankdplyop/packages/crfsuite/include -I/bankapp/bankdplyop/anaconda3/include/python3.6m -c export_wrap.cpp -o build/temp.linux-x86_64-3.6/export_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
export_wrap.cpp: In function ‘swig_module_info* SWIG_Python_GetModule()’:
export_wrap.cpp:2453: error: ‘PyCObject_Import’ was not declared in this scope
export_wrap.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’:
export_wrap.cpp:2522: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
export_wrap.cpp:2513: warning: unused variable ‘swig_empty_runtime_method_table’
export_wrap.cpp: In function ‘swig_type_info* SWIG_Python_TypeQuery(const char*)’:
export_wrap.cpp:2545: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope
export_wrap.cpp:2550: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
export_wrap.cpp: In function ‘std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >* std_vector_Sl_CRFSuite_Attribute_Sg____getitem____SWIG_0(std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, PySliceObject)’:
export_wrap.cpp:4695: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘void std_vector_Sl_CRFSuite_Attribute_Sg____setitem____SWIG_0(std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, PySliceObject, const std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >&)’:
export_wrap.cpp:4704: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘void std_vector_Sl_CRFSuite_Attribute_Sg____delitem____SWIG_1(std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, PySliceObject)’:
export_wrap.cpp:4713: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: At global scope:
export_wrap.cpp:4727: error: redefinition of ‘struct swig::traits<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > >’
export_wrap.cpp:4635: error: previous definition of ‘struct swig::traits<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > >’
export_wrap.cpp: In function ‘std::vector<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, std::allocator<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > > >* std_vector_Sl_CRFSuite_Item_Sg____getitem____SWIG_0(std::vector<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, std::allocator<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > > >, PySliceObject)’:
export_wrap.cpp:4780: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘void std_vector_Sl_CRFSuite_Item_Sg____setitem____SWIG_0(std::vector<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, std::allocator<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > > >, PySliceObject, const std::vector<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, std::allocator<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > > >&)’:
export_wrap.cpp:4789: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘void std_vector_Sl_CRFSuite_Item_Sg____delitem____SWIG_1(std::vector<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute >, std::allocator<std::vector<CRFSuite::Attribute, std::allocatorCRFSuite::Attribute > > >, PySliceObject)’:
export_wrap.cpp:4798: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >* std_vector_Sl_std_string_Sg____getitem____SWIG_0(std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, PySliceObject)’:
export_wrap.cpp:5047: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘void std_vector_Sl_std_string_Sg____setitem____SWIG_0(std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, PySliceObject, const std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >&)’:
export_wrap.cpp:5056: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
export_wrap.cpp: In function ‘void std_vector_Sl_std_string_Sg____delitem____SWIG_1(std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, PySliceObject)’:
export_wrap.cpp:5065: error: cannot convert ‘PySliceObject*’ to ‘PyObject*’ for argument ‘1’ to ‘int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)’
error: command 'g++' failed with exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant