2015-12-21 61 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。一旦建成,你就可以將它複製到目標上,並且它可以正常工作。 –