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.
相关推荐
易保山1 分钟前
MIT6.S081 - Lab6 Copy-on-Write(写时复制)
linux·操作系统·c
獨枭20 分钟前
Linux 下安装和使用 Jupyter Notebook
linux·chrome·jupyter
Monee..30 分钟前
linux里安装pip和conda
linux·conda·pip
阳区欠1 小时前
【Linux】进程通信
linux·运维·服务器·共享内存·进程通信·system v·管道文件
may_一一1 小时前
终端SSH连接工具SecureCRT安装和连接Linux
运维·服务器·ssh
姓刘的哦2 小时前
Ubuntu环境安装
linux·运维·ubuntu
小小寂寞的城2 小时前
Ubuntu里安装Jenkins
ubuntu·ci/cd·docker·jenkins
春生黎至10053 小时前
GZ073网络系统管理赛项赛题第1套模块A:网络构建解题笔记
运维·网络
IT程序媛-桃子3 小时前
【网安面经合集】42 道高频 Web 安全面试题全解析(附原理+防御+思路)
运维·网络·安全·面试
❀͜͡傀儡师3 小时前
多台服务器上docker部署 Redis 集群
运维·服务器·redis