c++ - 如何交叉编译C++文件

标签 c++ linux cross-compiling

我已经安装了arm交叉编译包

sudo apt install -y build-essential gcc-arm-linux-gnueabi

如果我编译hello.c 文件,它会完美运行

arm-linux-gnueabi-gcc hello.c

如果我使用hello.cpp 文件,它会报错

arm-linux-gnueabi-gcc hello.cpp

显示如下错误

arm-linux-gnueabi-gcc: error trying to exec 'cc1plus': execvp: No such file or directory

请帮助我。

最佳答案

安装g++-arm-linux-gnueabi:

sudo apt install -y g++-arm-linux-gnueabi

并改为调用 arm-linux-gnueabi-g++:

arm-linux-gnueabi-g++ hello.cpp

关于c++ - 如何交叉编译C++文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59676966/

相关文章:

linux - linux上的共享库问题

php - Curl在XAMPP和LARAGON上工作,但在Ubuntu APACHE2/CentOS APACHE上不行

c++ - 快速插入和快速搜索的正确数据结构?

c++ - 为什么 Visual Studio 不将无符号值显示为 int?

c++ - jsoncpp 只写一个元素的json数组

linux - 如果内核是交叉编译的,我必须交叉编译模块吗?

linux - 使用工具链时出现 execv 错误

c++ - Setter 和 getter 的必要性

windows - 如何在 Windows 中打开一个 Linux 风格的分区/dev/sdXY?

linux - 使用 DirectFB 交叉编译 SDL2 并添加到 Buildroot 根文件系统