2015-12-21 64 views
0

由于标准Qt包含文件/库丢失,编译失败,为什么?Qt无法找到标准标头

我有设备的自定义工具链。我的编译失败的消息:包括来自/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include/QtCore/QString:1:0, 从./menuitems/Item

在文件。 h:5, from /appmessages/AppMessageAgeLimit.h:4, from appmessages/AMessageDispatcher.cpp:2: /opt/STM/STLinux-2.3/devkit/sh4/target/usr/include/QtCore/qstring。小时:60:22:致命错误:字符串:没有这样的文件或目录

它猜测这个工具链配置错了,但我不知道如何解决它。以下是从“/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/viatcheslavvgavrilov/qt/gcc-4.8.2/configure --target = sh4-linux --prefix =/opt/STM/STLinux-2.3/devkit/sh4 --exec-prefix =/opt/STM/STLinux-2.3/devkit/sh4 --bindir =/opt/STM/STLinux-2.3/devkit/sh4/bin --sbindir =/opt/STM/STLinux-2.3// dev/STM/STLinux-2.3/devkit/sh4/etc --datadir =/opt/STM/STLinux-2.3/devkit/sh4/share --includedir =/opt/STM/STLinux-2.3/devkit/sh4/include --libdir =/opt/STM/STLinux-2.3/devkit/sh4/lib --libexecdir =/opt/STM/STLinux-2.3/devkit/sh4/libexec --localstatedir =/opt/STM/STLinux-2.3/devkit/sh4/var --sharedstatedir =/opt/STM/STLinux-2.3/devkit/sh4/share --mandir =/opt/STM/STLinux-2.3/devkit/sh4/-infodir = /选择/ STM/STLinux-2.3/DEVK it/sh4/info --enable-checking = assert --program-prefix = sh4-linux- --with-local-prefix =/opt/STM/STLinux-2.3/devkit/sh4 --with-sysroot =/opt /STM/STLinux-2.3/devkit/sh4/target --enable-languages = c,C++ --enable-threads = posix --enable-nls --enable-c99 --enable-long-long --with-system -zlib --enable-shared --disable-libgomp --enable-multilib --with-multilib-list = m4,m4-nofpu --enable-symvers = gnu --with-gxx-include-dir =/target/usr/include目录/ C++/4.2.4 --enable -__ cxa_atexit 线程模型:POSIX gcc版本4.8.2 20131016(GCC)

+0

你应该问这个问题吧?我只能假设你想要解决这个问题,但是到这里更复杂的帖子应该包含带问号的陈述,我想。我相信任何问题都应该是这里的具体问题陈述。 – AlexanderVX

回答

0

The compilation is failing due to standard Qt include files/ library missing, why?

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

[Paths] 
Prefix=/some/path 

随着我的几个静态建Qt的味道,通常设置为一个:

[Paths] 
Prefix=/specific_prebuilt_qt/src/qtbase 

及默认前缀可能指向一个目录下最多可以是有效的情况下,但然后确保路径的Qt工具链是正确的。或者你打算使用Qt的文件夹bin? qmake工具所在的文件夹。

[Paths] 
Prefix=.. 

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

+0

是的,这是我想问的。不幸的是我没有qt.conf。我的工具链的安装很简单,复制到opt目录。我想这是我的问题的根源。我没有任何其他方式来安装它。可能是我应该编辑qmake.conf文件来解决我的问题。 –

+0

请注意文件名:qt.conf,它位于Qt bin目录下。 – AlexanderVX

+0

@RomanKazmin你需要建立一个安装目录设置为与目标上相同的Qt。一旦建成,你就可以将它复制到目标上,并且它可以正常工作。 –