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.
相关推荐
不会代码的小猴26 分钟前
Linux环境编程第六天笔记--system-V IPC
linux·笔记
阳光九叶草LXGZXJ31 分钟前
达梦数据库-学习-48-DmDrs控制台命令(同步之Manager、CPT模块)
linux·运维·数据库·sql·学习
诸神缄默不语33 分钟前
Linux命令行教程
linux
小二李2 小时前
第11章 nestjs服务端开发:登录鉴权
运维·服务器
i建模3 小时前
如何在Arch Linux中重设忘记的root密码
linux·运维·服务器
chatexcel4 小时前
元空AI+Clawdbot:7×24 AI办公智能体新形态详解(长期上下文/自动化任务/工具粘合)
运维·人工智能·自动化
kida_yuan4 小时前
【Linux】运维实战笔记 — 我常用的方法与命令
linux·运维·笔记
@syh.4 小时前
【linux】进程控制
linux
何中应6 小时前
vmware的linux虚拟机如何设置以命令行方式启动
linux·运维·服务器
江畔何人初6 小时前
kubernet与docker的关系
linux·运维·云原生