我已经解决了这个问题一个多星期了。我在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编译器手动编译了这个程序。有什么建议吗?
答案 0 :(得分:0)
make参数错误。具体做法是:
unrecognized option '--major-image-version'
你应该删除参数&#34; - major-image-version&#34;从你的项目的Makefile LFLAGS。
在Windows上有3个makefile,Makefile,Makefile.debug和Makefile.release
从与当前构建配置匹配的参数中删除参数。