1. 程式人生 > >centos安裝libxml2時編譯出錯

centos安裝libxml2時編譯出錯

錯誤資訊

libxml.c:3909: error: 'PyObject' undeclared (first use in this function)
libxml.c:3909: error: 'module' undeclared (first use in this function)
libxml.c:3915: warning: implicit declaration of function 'Py_InitModule'
libxml.c:3915: warning: nested extern declaration of 'Py_InitModule'
libxml.c:3915: error: 'libxmlMethods'
undeclared (first use in this function) make[4]: *** [libxml.lo] Error 1 make[4]: Leaving directory `/usr/local/src/libxml2-2.9.2/python' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/usr/local/src/libxml2-2.9.2/python' make[2]: *** [all] Error 2 make[2]: Leaving directory `/usr/local/src/libxml2-2.9.2/python'
make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/libxml2-2.9.2' make: *** [all] Error 2

解決方法
安裝依賴的python-devel軟體包

 yum -y install python-devel