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.
相关推荐
VirusVIP2 小时前
Windows CMD通过adb检查触摸屏Linux驱动是否被编译
linux·运维·adb
chennalC#c.h.JA Ptho2 小时前
ubuntu studio 系统详解
linux·运维·服务器·经验分享·ubuntu·系统安全
yt948326 小时前
Docker-基础(数据卷、自定义镜像、Compose)
运维·docker·容器
水银嘻嘻8 小时前
web 自动化之 KDT 关键字驱动详解
运维·自动化
Vone_668 小时前
node.js 邮箱验证服务器搭建
运维·服务器·node.js
丢丢丢丢丢丢~9 小时前
apache2的默认html修改
linux·运维·服务器
wusam9 小时前
Linux系统管理与编程20:Apache
linux·运维·服务器·apache·shell编程
我不想当小卡拉米9 小时前
【Linux】操作系统入门:冯诺依曼体系结构
linux·开发语言·网络·c++
ChironW9 小时前
Ubuntu 24.04 LTS系统上配置国内时间同步
linux·运维·服务器·ubuntu
TPBoreas9 小时前
排查服务器内存空间预警思路
运维·服务器