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 天前
【Playwright自动化】录制生成脚本
运维·自动化
java_logo1 天前
MySQL Server Docker 容器化部署指南
linux·运维·数据库·docker·容器
I***t7161 天前
自己编译RustDesk,并将自建ID服务器和key信息写入客户端
运维·服务器
誰能久伴不乏1 天前
Linux文件套接字AF_UNIX
linux·服务器·c语言·c++·unix
BJ_Bonree1 天前
数智先锋 | 核心应用响应时常<1s、多终端崩溃率低至 0.1%!Bonree ONE 赋能蓝月亮应用性能与终端体验双重升级!
运维
张鱼小丸子1 天前
电脑刷机教程:轻松重装系统指南
运维
a41324471 天前
如何解决centos上oracle连接问题
linux·oracle·centos
h***34631 天前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos
星释1 天前
Rust 练习册 97:Run-Length Encoding 压缩算法
java·linux·rust