Installing C++ Compiler on UNIX/Linux

Installing C++ Compiler on UNIX/Linux

Installing a C++ compiler (usually <span>g++</span> or <span>clang++</span>) on UNIX/Linux systems is the first step in C++ development. As a typical UNIX-like system, most Linux distributions natively support or can easily install C++ compilers. Below, I will detail how to install a C++ compiler on popular Linux distributions (such as Ubuntu, Debian, CentOS, Fedora, Arch, … Read more

Basic Operations for Compiling with gcc and g++

Generally, compilation requires support from library files. For example, static library files and dynamic library files. On Windows, .lib files are static library files. .dll files are dynamic library files. The suffix for library files is as follows: The suffix for static library files is .a. The suffix for dynamic library files is .so. The … Read more

Compiling C++ Programs with CMake on Linux

Compiling C++ Programs with CMake on Linux

Compiling C++ Programs with CMake on Linux 1. Compiling a Single .cpp File with g++ Use g++/gcc to compile a .cpp file and generate an executable file named .out g++ main.cpp 1. Create the file main.cpp #include <iostream>using namespace std; int main(){ cout<<"hello world"<<endl; return 0;} 2. Compile the file to generate the executable file … Read more

Understanding gcc and g++ Compilers in Linux for Informatics Competitions

Understanding gcc and g++ Compilers in Linux for Informatics Competitions

Students, in the world of Linux, the gcc and g++ compilers are like “super craftsmen” in programming for informatics competitions, capable of “polishing” our written code into instructions that the computer can understand. Next, let’s delve into the usage of these two “super craftsmen”. gcc Compiler (primarily for C language) 1. Basic Compilation: Suppose you … Read more

Mastering GCC/G++/GDB: From Compilation to Debugging

Mastering GCC/G++/GDB: From Compilation to Debugging

Introduction: GCC/G++/GDB, The Programmer’s “Magic Wand” Hello everyone, today we will discuss how to compile and debug C/C++ programs. When it comes to GCC/G++, many beginners might first think: “Isn’t this just a compiler? Don’t you just write gcc main.c and hit enter?” But when compilation errors occur, they realize their understanding is as shallow … Read more

Differences Between GCC and G++: A Comprehensive Guide

Differences Between GCC and G++: A Comprehensive Guide

GCC (GNU Compiler Collection) and G++ are both compilers developed by GNU, but they have some functional differences. Although they belong to the same toolset, the main difference lies in the programming languages they support and how they handle the compilation of source code. Here is a detailed introduction and comparison of GCC and G++. … Read more

Essential Makefile Guide: Step-by-Step Project Compilation!

Linux | Red Hat Certified | IT Technology | Operations Engineer 👇1000 people technical exchange QQ group, note 【public number】 for faster access 1. Basic Structure of Makefile The Makefile contains a series of “rules”, with the basic structure of each rule as follows: target…: prerequisites… <tab> command Target(target): usually the name of the file … Read more

Setting GCC Version When Installing VASP on Ubuntu

Setting GCC Version When Installing VASP on Ubuntu

Currently, supercomputing servers and individual servers are increasingly using the Ubuntu system, especially after the CentOS7 system, which is widely used, has stopped updating. When using the Windows system’s built-in subsystem for computational practice, the installation and acquisition of Ubuntu are more convenient and straightforward. Installing VASP in the initial environment of Ubuntu requires configuring … Read more

What Are GCC and G++? Understanding Their Differences

What Are GCC and G++? Understanding Their Differences

Source: C Language Chinese Network Editor: strongerHuang As of September 2020, the GCC compiler has been updated to version 10.2, and its functionality has expanded from initially only compiling C language to now supporting multiple programming languages, including C++. In addition, the current GCC compiler also supports compiling programs in Go, Objective-C, Objective-C++, Fortran, Ada, … Read more