1.4. 设置以使用 C 和 C++ 开发应用程序

Red Hat Enterprise Linux 包括用于创建 C 和 C++ 应用程序的工具。

先决条件

  • 必须启用 debug 和 source 存储库。

步骤

  1. 安装 Development Tools 软件包组,包括 GNU Compiler Collection(GCC)、GNU Debugger(GDB)和其他开发工具:

    # dnf group install "Development Tools"
  2. 安装基于 LLVM 的工具链,包括 clang 编译器和 lldb 调试器:

    # dnf install llvm-toolset
  3. 可选:对于 Fortran 依赖项,请安装 GNU Fortran 编译器:

    # dnf install gcc-gfortran