Qt找不到标准标头



由于缺少标准Qt include文件/库,编译失败,原因是什么?

我为设备定制了工具链。我的编译失败,返回消息:

在/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include/QtCore/QString:1:0中包含的文件中,来自/menuitems/Item.h:5,来自/appmessages/AppMessageAgeLimit.h:4,来自appmessages/AMessageDispatcher.cpp:2:/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include/QtCore/qstring.h:60:22:致命错误:string:没有这样的文件或目录

我猜这个工具链配置错误,但我不知道如何修复它。下面是"/opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-g++-v"命令的输出-可能会有用:

使用内置规格。COLLECT_GCC=/opt/STM/STLinux-2.3/devkit/sh4/bin/sh4-linux-g++COLLECT_LTO_WRAPPER=/opt/STM/STLinux-2.3/devkit/sh4/libexec/gcc/sh4-linux/4.8.2/LTO-WRAPPER目标:sh4-linux配置为:/home/viatcheslavgavrilov/qt/gcc-4.8.2/configure--target=sh4-linux--prefix=/opt/STM/STLinux-2.3/devkit/sh4--exec prefix=/ot/STM/STLinux-2.3/devkit/sh4--bindir=/opt/STM/STLinux-2.3/devkit/sh4/bin--sbindir=/opt/STM/STLinux-2.3/devkit/sh4-sbin--sysconfdir=/opt/STM/STLinux-2.3-devkit/sh 4/etc--datadir=/opt/STM/STLinux-3.3/devkik/sh4/share--includedir=/opt/STM/STLinux-2.3/devkit/sh4/include--libdir=/opt/STM/STLinux-3.3/devkik/sh4/lib--libexecdir=/opt/STM/STLinux-2.3/devkit/sh4-libexec--localstatedir=/opt-STM/STLinux-23/devkitsh4/var--sharedstatedir=/opt_STM/STLinux 2.3/devkit/sh4/share--mandir=/opp/STM/STLinux 2.23/devkit/sh4/man--infodir=/opt:启用检查=断言--program prefix=sh4 linux---带本地前缀=/opt/STM/STLinux-2.3/devkit/sh4-带sysroot=/opt/STM/STLinux-2.3/devkit/sh4/target--启用语言=c,c++--启用线程=posix--启用nls--启用-c99--启用long-long--带系统zlib--启用共享--禁用libgomp--启用multilib--带multilib列表=m4,m4-nopu--启用symvers=gnu--使用gxx include-dir=/target/usr/include/c++/44.2.4--启用-_cxa_atexit螺纹型号:posixgcc版本4.8.2 20131016(gcc)

由于缺少标准Qt include文件/库,编译失败,为什么?

检查qt.conf文件部分的路径前缀通常有帮助:

[Paths]
Prefix=/some/path

对于我的几个静态构建的Qt风格,它通常设置为以下之一:

[Paths]
Prefix=/specific_prebuilt_qt/src/qtbase

默认前缀可能指向上一个目录,这可能是有效的情况,但要确保Qt工具链的路径是正确的。或者,您打算使用的Qt的bin文件夹在哪里?qmake工具所在的文件夹。

[Paths]
Prefix=..

确保在前缀路径固定后,在再次构建之前为您的项目执行qmake。

最新更新