我目前正在用C语言构建一个python模块,我已经跟随了一系列教程来了解我自己的构建点,并且我已经很好地掌握了正在发生的事情。在
但是,当我运行脚本来设置所有内容时,我有以下打印输出。看起来这个错误来自python-dev中的一个头文件;但是,我想在这里确认这不是我正在做的事情。我将包括错误代码,我可以提供其他文件的要求。在
sudo python setup.py build
running build
running build_ext
building 'lidar' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c lidar_module.c -o build/temp.linux-armv6l-2.7/lidar_module.o
lidar_module.c: In function ‘lidar_test’:
lidar_module.c:8:6: warning: unused variable ‘sts’ [-Wunused-variable]
int sts = 0;
^
In file included from /usr/include/python2.7/Python.h:58:0,
from lidar_module.c:1:
lidar_module.c: At top level:
/usr/include/python2.7/pyport.h:802:39: error: expected ‘,’ or ‘;’ before ‘void’
# define PyMODINIT_FUNC void
^
lidar_module.c:24:1: note: in expansion of macro ‘PyMODINIT_FUNC’
PyMODINIT_FUNC initlidar(){
^
lidar_module.c:3:18: warning: ‘lidarError’ defined but not used [-Wunused-variable]
static PyObject *lidarError;
^
lidar_module.c:19:20: warning: ‘lidar_methods’ defined but not used [-Wunused-variable]
static PyMethodDef lidar_methods[] = {
^
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
我偷看了一下头文件,在错误区域附近找到了这个。在
^{pr2}$
我不得不搜索控制台的行号输出,但我确实在这里找到了解决方案: Build Python (2.7) module on GCC 4.8 fails
相关问题 更多 >
编程相关推荐