Monday, January 25, 2016

How to install C/C++ compiler on Ubuntu

If you want to run a C or C++ program you will need a C/C++ compiler to compile the source code into executable or binary. On ubuntu, you can install package called 'build-essential' to have a C and C++ compiler on your system.

So if you are a C or C++ programmer, then you must have C/C++ compiler on your ubuntu, so that you can compile your source code that you have been working on into executable program.

Alright, to install C/C++ compiler on ubuntu, all you have to do is open terminal/command line/console (press CTRL + ALT + T), and then run this command:

sudo apt-get install build-essential

Basically what build essential do is installing C compiler called 'gcc', C++ compiler which is called 'g++', a 'make' utility tool, and a bunch of C library and header files.

List of build essential packages :
  • dpkg-dev (debian package development tools)
  • g++ (GNU C++ compiler)
  • gcc (GNU C compiler)
  • libc6-dev (GNU C library, development libraries and header files)
  • make (utility for directing compilation)

That's it, now you should be able to compile your C/C++ source code, use gcc to compile C programming language source code, and use g++ to compile C++ source code, or just use make utility program it should works too.

~ happy coding ~

No comments:

Post a Comment