简体   繁体   English

如何在 CentOS 和 RedHat Linux 上安装和编译 C++ 代码?

[英]How to install and compile C++ code on CentOS and RedHat Linux?

I am currently using CentOS.我目前正在使用 CentOS。 I have tried installing g++ but there terminal shows Error: Unable to find a match .我尝试安装 g++ 但终端显示Error: Unable to find a match

  1. Using yum install gcc-c++ you can install c++ compiler.使用yum install gcc-c++可以安装 c++ 编译器。

  2. Now, you can run g++ HelloWorld.cpp to compile.现在,您可以运行g++ HelloWorld.cpp进行编译。

  3. To run the program type ./a.out in terminal.在终端中运行程序类型./a.out

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM