我已经在Qt4.x中创建了项目,现在我正在Qt5.3.1上编译该项目。
该项目在Windows上编译良好,但是在Android上编译时出现以下错误
:-1:错误:没有规则可以使目标'........ \\ Softwares \ Android-SDK-NDK-ANT \ android-ndk-r9d-windows-x86_64 \ android-ndk-r9d \ sources \ cxx -STL \ gnu-libstdc++ \ 4.8 \ include \ profile \ impl \ profiler_map_to_unordered_map.h',由'ui_main_window.h'所需。停止
请帮忙,
提前致谢
最佳答案
这很可能与this bug有关,也在this blog post中进行了讨论。您在Windows上(第一个提示),您的NDK路径似乎很长(第二个提示)。这些事实与Qt Creator倾向于创建的漫长路径相结合,会生成长时间无法达到操作系统限制的路径,然后奇怪的和隐秘的错误会突然出现。
直接引用链接的帖子:
Try installing the NDK directly in the root with a short directory name, and have a shallow directory structure for the project you are building. If you still have problems, try turning off shadow building, as this appends a long directory name to your path.
就我个人而言:
C:\AdtBundle\sdk
C:\AdtBundle\ndk9d
C:\Ant
(由于关于Ant
目录路径的错误决定而发生很多部署错误)设置了如此简单的目录结构后,由于路径太长/不好,我从未遇到过任何奇怪的错误。
关于android - 在Qt中编译项目时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27639507/