QT设置64位的交叉编译器project error : cannot run target compiler ' aarch64-linux-gnu-g++"
时间: 2024-05-12 09:16:35 浏览: 13
这个错误可能是由于Qt Creator没有正确配置交叉编译器引起的。你可以尝试以下步骤来解决这个问题:
1. 确保你安装了正确的交叉编译器。例如,在Ubuntu上,你可以使用以下命令安装64位的交叉编译器:
```
sudo apt-get install g++-aarch64-linux-gnu
```
2. 在Qt Creator中打开项目,然后在左侧的“项目”窗口中选择“Build & Run”。
3. 在“Build & Run”窗口中,选择“Compilers”选项卡,然后单击“Add”按钮。
4. 在“Add Compiler”对话框中,选择“GCC”作为编译器类型,然后单击“OK”。
5. 在“Compiler path”字段中输入你的交叉编译器的完整路径,例如:
```
/usr/bin/aarch64-linux-gnu-g++
```
6. 在“ABI”字段中选择“Generic Linux Device”。
7. 单击“Apply”按钮,然后关闭“Build & Run”窗口。
8. 重新编译你的项目,看看是否解决了问题。
如果你仍然遇到问题,你可以尝试在终端中手动编译你的代码,以便更好地了解错误的原因。你可以使用以下命令:
```
aarch64-linux-gnu-g++ -o myapp main.cpp
```
请将“myapp”替换为你的应用程序名称,将“main.cpp”替换为你的源代码文件。如果编译器仍然无法运行,请检查你的交叉编译器是否正确安装,并确保你的路径设置正确。
相关问题
project error : cannot run target compiler ' aarch64-linux-gnu-g++"
This error message indicates that the target compiler for the AArch64 architecture is not installed or not properly configured on your system.
To fix this error, you need to install the AArch64 cross-compiler toolchain for your system. You can do this by running the following command in your terminal:
```
sudo apt-get install gcc-aarch64-linux-gnu
```
If you are using a different Linux distribution or operating system, you may need to install the AArch64 cross-compiler toolchain from a different package repository or source.
Once you have installed the AArch64 cross-compiler toolchain, you should be able to compile your project for the AArch64 architecture without encountering this error.
aarch64-linux-gnu-gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
This error message indicates that the compiler is not recognizing the argument "-mabi=apcs-gnu". This could happen if the version of the compiler being used is outdated, or if the option is not supported by the compiler.
To resolve this issue, try updating to the latest version of the compiler, or use a different option that is supported by the compiler. You can also check the compiler documentation for more information on the supported options.