在 Debian 上安装 C++ 开发环境
一 安装步骤
二 验证安装
#include <iostream>
int main() { std::cout << "Hello from C++ on Linux!\n"; return 0; }
编译与运行:g++ hello.cpp -o hello && ./hello。若输出 Hello from C++ on Linux!,说明环境可用。三 常用开发工具(按需安装)
四 进阶 多版本编译器与标准库文档
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
sudo update-alternatives --config gcc
sudo update-alternatives --config g++