Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the powerful CumberCraft + Compiler on Linux system

Shulou Source: shulou.com Published: 2022-06-02 22:38:46 10月03日 Update

In this issue, the editor will bring you about how to use the powerful Cmax Candle + compiler on the Linux system. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

In the process of compilation, it is found that the C++ compiler is a very powerful Cmax Candle + compiler, which is characterized by high speed and high space efficiency. Its version supports 92.73% of the standardized C++, which greatly supports the CPU optimization work.

If you have two or a few C source files, you can also easily compile, link, and generate executables using GCC. For example, suppose you have two source files, main.c and factorial.c, and now you want to compile and generate a program for calculating factorials.

List main.c

# include # include int factorial (int n); int main (int argc, char * * argv) {int n; if (argc < 2) {printf ("Usage:% s n", argv [0]); return-1;} else {n = atoi (argv [1]); printf ("Factorial of% d is% d.", n, factorial (n));} return 0;}

GCC can be used to compile both C programs and C++ programs. Generally speaking, the C compiler determines whether it is a C program or a C++ program by the suffix name of the source file. In linux, the C source file has the suffix .c, while the C++ source file has the suffix .C or .cpp.

However, the gcc command can only compile C++ source files, not automatically connect to the libraries used by C++ programs. Therefore, the C++ + command is usually used to complete the compilation and connection of the C++ program, and the program will automatically call gcc to achieve compilation. Suppose we have a C++ source file (hello.C) as follows:

# include void main (void) {cout

Tags: Compiling compiling clocking source files programs powerful things development two suffixes commands open support generation system content original foundation war platform Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux NVidia macOS OPPO Reno Microsoft