make Making all in src make[1]: Entering directory '/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7/src' /usr/bin/python ./c_client.py -p //usr/lib/python3.8/site-packages //usr/share/xcb/xproto.xml File "./c_client.py", line 1020 print 'Usage: c_client.py [-p path] file.xml' ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Usage: c_client.py [-p path] file.xml')? make[1]: *** [Makefile:1018: xproto.c] Error 1 make[1]: Leaving directory '/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7/src' make: *** [Makefile:450: all-recursive] Error 1
时间: 2023-08-06 18:07:43 浏览: 156
这个错误是因为 `c_client.py` 的 Python 版本不兼容导致的。在 Python 3 中,`print()` 函数需要加上括号,而在 Python 2 中则不需要。因此,你需要将 `c_client.py` 中的所有 `print` 函数都改成带括号的形式。
你可以使用以下命令来查看你的 Python 版本:
```
python --version
```
如果是 Python 3,请将 `print` 改为 `print()`。如果是 Python 2,请不用改动。
相关问题
make Making all in src make[1]: Entering directory '/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7/src' /usr/bin/python ./c_client.py -p //usr/lib/python3.8/site-packages //usr/share/xcb/xinput.xml Failed to load the xcbgen Python package! Make sure that xcb/proto installed it on your Python path. If not, you will need to create a .pth file or define $PYTHONPATH to extend the path. Refer to the README file in xcb/proto for more info. Traceback (most recent call last): File "./c_client.py", line 1027, in <module> from xcbgen.state import Module ImportError: No module named xcbgen.state make[1]: *** [Makefile:1018: xinput.c] Error 1 make[1]: Leaving directory '/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7/src' make: *** [Makefile:450: all-recursive] Error 1 root@asu:/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7# make Making all in src make[1]: Entering directory '/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7/src' /usr/bin/python ./c_client.py -p //usr/lib/python3.8/site-packages //usr/share/xcb/xinput.xml File "./c_client.py", line 1016 except getopt.GetoptError, err: ^ SyntaxError: invalid syntax make[1]: *** [Makefile:1018: xinput.c] Error 1 make[1]: Leaving directory '/home/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libxcb-1.7/src' make: *** [Makefile:450: all-recursive] Error 1
这是一个编译错误,看起来是缺少了一个 Python 模块。错误信息中提到了 `xcbgen` 模块,你可以尝试安装这个模块来解决问题。
你可以通过 pip 命令来安装 xcbgen:
```
pip install xcbgen
```
如果你没有安装 pip,可以通过以下命令安装:
```
sudo apt-get install python-pip
```
另外,还有一个语法错误,是因为 Python 2.x 和 Python 3.x 在异常处理上有些不同。你可以将 `except getopt.GetoptError, err:` 改为 `except getopt.GetoptError as err:` 来解决这个问题。
make[2]: Entering directory '/home/test/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libdrm-2.4.36/libkms' CC linux.lo linux.c: In function 'linux_name_from_sysfs': linux.c:76:2: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration] maj = major(buffer.st_rdev); ^ linux.c:76:2: warning: nested extern declaration of 'major' [-Wnested-externs] linux.c:77:2: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration] min = minor(buffer.st_rdev); ^ linux.c:77:2: warning: nested extern declaration of 'minor' [-Wnested-externs] cc1: some warnings being treated as errors make[2]: *** [Makefile:409: linux.lo] Error 1 make[2]: Leaving directory '/home/test/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libdrm-2.4.36/libkms' make[1]: *** [Makefile:612: all-recursive] Error 1 make[1]: Leaving directory '/home/test/GPU_Project/ARM-Mali-G72/Software_packet/DDK-Compile_Tool/lib_file/libdrm-2.4.36' make: *** [Makefile:394: all] Error 2
这个错误是因为在 linux.c 文件中使用了 major 和 minor 函数,但是编译器无法找到它们的声明。可以尝试在文件开头添加如下代码:
```
#include <sys/sysmacros.h>
```
这个头文件包含了 major 和 minor 函数的声明。如果还是无法解决问题,可能需要检查是否有其他头文件缺失或者链接库没有正确链接。
阅读全文