Compiling C++ Programs

Author
By Darío Rivera
Posted On in Lenguaje C++

In a previous post we saw how to create our first program in C++, the classic Hello World!. However, we did not see at any time how to run said program. Today we will see how to compile and run this simple program.

Compiler Installation

Most Linux systems come with C and C++ compilers. On GNU/Linux Debian based systems, just run the following command to install the compiler.

sudo apt-get install g++

Compilation

To compile programs developed in C just run the following command.

g++ -o out program.c output

Where program.c is the file with C code and output will be the compiled file that will be generated.

Execution

To run the program just execute it as follows:

./output

Acerca de Darío Rivera

Author

Application Architect at Elentra Corp . Quality developer and passionate learner with 10+ years of experience in web technologies. Creator of EasyHttp , an standard way to consume HTTP Clients.

LinkedIn Twitter Instagram

Sólo aquellos que han alcanzado el éxito saben que siempre estuvo a un paso del momento en que pensaron renunciar.