簡體   English   中英

交叉編譯設置期間的QT GCC錯誤

[英]QT GCC Error During Cross Compile Setup

我一直在解決這個問題超過一個星期。 我在QT網站附近安裝了免費版本的QT。 我正在嘗試為Beaglebone Black ARM 8平台建立交叉編譯環境。 我已經使用GNU ARM 6.3.0 GNU編譯器設置了編譯器選項-與我的BBB上的編譯器相同。 我成功創建了交叉編譯環境和Beaglebone設備。 連接測試也正常工作。

這是我嘗試編譯的簡單C ++應用程序,

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}

這是我的QT gcc編譯選項的樣子,

在此處輸入圖片說明

這是我的套件設置,

在此處輸入圖片說明

這是我的設備設置,

在此處輸入圖片說明

當我構建默認的QT簡單應用程序時,出現這些錯誤,

Running Windows Runtime device detection.
C:/Qt/5.11.0/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
Found 2 Windows Runtime devices.
Running "C:\Program Files (x86)\CMake\bin\cmake.exe -E server "--pipe=\.\pipe{2e664e46-cacb-46ae-b680-ed9c235dc502}" --experimental" in C:\Users\Stephen\AppData\Local\Temp\QtCreator-WLEKuI\qtc-cmake-IDzcFnnJ.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-g++.exe", "-DCMAKE_C_COMPILER:STRING=C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe", "-DCMAKE_PREFIX_PATH:STRING=", "-DQT_QMAKE_EXECUTABLE:STRING=".
The C compiler identification is GNU 6.3.0
The CXX compiler identification is GNU 6.3.0
Check for working C compiler: C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe
Check for working C compiler: C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe"
is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/Stephen/AppData/Local/Temp/QtCreator-WLEKuI/qtc-cmake-IDzcFnnJ/CMakeFiles/CMakeTmp

Run Build Command:"C:/PROGRA~2/Ninja/ninja.exe" "cmTC_c3136"
[1/2] Building C object CMakeFiles/cmTC_c3136.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_c3136.exe
FAILED: cmTC_c3136.exe 
cmd.exe /C "cd . && C:\SysGCC\beaglebone-6.3.0\bin\arm-linux-gnueabihf-gcc.exe    CMakeFiles/cmTC_c3136.dir/testCCompiler.c.obj  -o cmTC_c3136.exe -Wl,--out-implib,libcmTC_c3136.dll.a -Wl,--major-image-version,0,--minor-image-version,0   && cd ."
c:/sysgcc/beaglebone-6.3.0/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: unrecognized option '--major-image-version'
c:/sysgcc/beaglebone-6.3.0/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

該構建似乎向GCC編譯器套件發出了一個命令,該命令會向名為ld.exe的可執行文件發出。 我驗證了ld.exe的路徑,並且確實在目錄中並處理了我的“ ld --version”命令。錯誤消息顯示ld.exe'--major-image-version'並失敗。 ld.exe不支持--major-image-version。 不知道為什么向ld.exe發出此命令。

我知道這些編譯器可以正常工作,因為我已經使用g ++ 6.3.0編譯器手動編譯了該程序。 有什么建議么?

make參數是錯誤的。 特別:

    unrecognized option '--major-image-version'

您應該從項目的Makefile LFLAGS中刪除參數“ --major-image-version”。

Windows上有3個makefile,Makefile,Makefile.debug和Makefile.release

從與您當前的構建配置匹配的參數中刪除該參數。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM