ubuntu 安装 g++

文章目录

  • 前提
  • [一、安装 g++](#一、安装 g++)
    • [1.1 安装](#1.1 安装)
    • [1.2 验证](#1.2 验证)

前提

安装 tflite_support 报错

bash 复制代码
error: subprocess-exited-with-error
RuntimeError: Unsupported compiler -- at least C++11 support is needed!

一、安装 g++

1.1 安装

bash 复制代码
# 安装编译工具链(如g++)和依赖库
sudo apt-get update
sudo apt-get install -y build-essential libstdc++6 g++-9  # 安装g++9或更高版本
  • gcc(GNU C编译器):用于编译C语言程序。
  • g++(GNU C++编译器):用于编译C++语言程序。
  • make:用于构建程序,通过读取Makefile文件来自动化编译过程。

1.2 验证

安装 g++ 会自动安装 gcc,因为 g++ 依赖于 gcc 的核心功能

bash 复制代码
# g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
相关推荐
张洛闻Eren6 小时前
Ansible【第一课】:Ansible介绍
运维·数据库·云原生·kubernetes·github·ansible
GeW6 小时前
以Linux为基、数据库为核:新质生产力路线图下的企业架构升级
linux
郝亚军6 小时前
RK3562 中有 mosquitto、nginx 了,还需要 http,ftp,tftp 等协议吗?
运维·nginx·http
忆挽篱笙歌6 小时前
进程的状态
linux·ubuntu
kyle~7 小时前
Linux --- Socket 用户进程与内核网络协议栈之间的统一接口
linux·arm开发·网络协议
重生之小比特7 小时前
【Linux系统】07 进程状态
linux·运维·服务器
敲代码的彭于晏7 小时前
2026 K8s 零基础入门:手把手教你一步步搭建 Kubernetes 集群
java·运维·全栈
ManageEngine卓豪7 小时前
智能运维如何降低 MTTR:告警聚类、因果分析与自动化修复的工程拆解
运维·智能运维·mttr
wangfenglei1234567 小时前
jenkins权限配置
运维·jenkins
ab1237688 小时前
Docker Compose 完整详解
运维·docker·容器