android - 在Qt中编译项目时出现错误

标签 android qt compiler-errors qt4 qt5

我已经在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/

    相关文章:

    android - 在 android 上使用 Fresco 库显示来自 SD 卡的图像

    Android 和 iPhone UI 组件比较

    c++ - 从 CSV C++ 中提取 double 值时出现意外结果

    c++ - 导致编译错误的意外模板实例化

    compiler-errors - 链接包括NetCDF代码的f90

    android - react native : Dev Server IP iOS vs Android

    android - Android 中 ScrollView 中的 EditText

    c++ - Qt5 QProcess 处理带有 "special"字符的参数

    macos - Qt 在停靠栏中显示进度条 (macOS)

    objective-c - UIAlertView dismissWithClickedButtonIndex :animated: method error