android-ndk - 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, PyUnicode_DecodeFSDefault, ni[i].if_name);
^
../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:62: error: dereferencing pointer to incomplete type
ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
^
没有 _socket 模块,整个交叉编译运行良好,没有错误。
解决方案
使用最新的 r23b 版本的 Android NDK 解决了问题。
推荐阅读
- python - 套接字服务器的客户端没有抛出一个错误,表明在不是套接字的东西上尝试了操作
- java - 带有非 Oracle JDK 的 Java 8 中的 JavaFX
- firebase - React Native Firebase Analytics:第二个参数必须是一个对象
- php - 未找到基表或视图 未找到表“tenancy.websites”
- reactjs - 在无状态组件上使用 React.memo() 时出错
- haskell - 从用户那里获取输入:Haskell
- sql-server - 通过 t-sql 为现有列配置 Always Encrypted
- c# - Internet Explorer 未重定向到 HTTPS,其他浏览器工作正常
- javascript - 使用 .sub() 和 react 创建化学式
- django - 如何从上一个错误/失败中恢复 Django 测试套件?