CPython 3.8 的交叉编译在 _socket 模块失败

问题描述

我正在尝试使用启用了 _socket 模块的 Android NDK 工具链交叉编译 cpython 3.8,但不幸的是编译失败:

../Modules/socketmodule.c:6739:5: error: invalid use of undefined type 'struct if_nameindex'
     for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
     ^
../Modules/socketmodule.c:6739:19: error: dereferencing pointer to incomplete type
     for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
                   ^
../Modules/socketmodule.c:6753:17: error: invalid use of undefined type 'struct if_nameindex'
                 ni[i].if_index,PyUnicode_DecodeFSDefault,ni[i].if_name);
                 ^
../Modules/socketmodule.c:6753:19: error: dereferencing pointer to incomplete type
                 ni[i].if_index,ni[i].if_name);
                   ^
../Modules/socketmodule.c:6753:17: error: invalid use of undefined type 'struct if_nameindex'
                 ni[i].if_index,ni[i].if_name);
                 ^
../Modules/socketmodule.c:6753:62: error: dereferencing pointer to incomplete type
                 ni[i].if_index,ni[i].if_name);
                                                              ^

没有_socket模块,整个交叉编译运行良好,没有错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)