【发布时间】:2017-09-01 11:03:20
【问题描述】:
我正在使用 pyqtdeploy 将一个非常简单的 python 脚本打包到 Qt 项目中。然后我将尝试将其编译为 .apk 文件。我认为目前环境已经搭建完成,包括Android SDK、Android NDK、Qt、android studio、ant等。运行pyqtdeploy时总是出现奇怪的错误。
这是我的代码:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
class Main(QWidget):
def __init__(self):
super().__init__()
self.build_inter()
def build_inter(self):
self.lb = QLabel("Test", self)
self.lb.move(0, 0)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
w = Main()
sys.exit(app.exec_())
截取了一部分错误信息:
..\include/pyport.h:617:60: error: expected constructor, destructor, or type conversion before '(' token
# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
^
..\include/fileutils.h:109:1: note: in expansion of macro 'PyAPI_FUNC'
PyAPI_FUNC(int) _Py_get_inheritable(int fd);
^
..\include/pyport.h:617:60: error: expected constructor, destructor, or type conversion before '(' token
# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
^
..\include/fileutils.h:111:1: note: in expansion of macro 'PyAPI_FUNC'
PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable,
^
..\include/pyport.h:617:60: error: expected constructor, destructor, or type conversion before '(' token
# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
^
..\include/fileutils.h:114:1: note: in expansion of macro 'PyAPI_FUNC'
PyAPI_FUNC(int) _Py_dup(int fd);
还有截图:
我的配置:
有没有人遇到过类似的问题?我该怎么办?
提前致谢!
【问题讨论】:
标签: android python qt apk pyqt5