我使用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);截图如下:

我的配置:

有人遇到过类似的问题吗?我该怎么做?
提前感谢!
发布于 2017-09-24 17:55:02
我远非专家,但在文档中,除非目标环境与源环境相同,否则勾选“运行应用程序”是没有意义的。从你的窗口看,你似乎是从windows到Android的交叉编译,因此我会尝试省略最后一个参数“额外的构建步骤”(“运行应用程序”)。然后你必须自己去测试,比如Android studio,我想。希望能有所帮助。
https://stackoverflow.com/questions/45998866
复制相似问题