Skip to main content

Posts

Showing posts with the label Programming in C with Linux

Programming in C using gcc in Linux

If you are using Linux or UNIX, then check whether GCC is installed on your system by entering the following command from the command line − $ gcc -v If you have GNU compiler installed on your machine, then it should print a message.If GCC is not installed, then you will have to install it yourself using the detailed instructions available at https://gcc.gnu.org/install/ Install GCC The following linux command will install gcc compiler on Ubuntu 18.04 Bionic Beaver( Latest version is 20.04 Focal Fossa) .Open up terminal and enter:  $sudo apt-get install gcc Install build-essential Another way to install gcc compiler is to install it as part of build-essential package. build-essential package will also install additional libraries as well as g++ compiler. In most cases or if unsure this is exactly what you need: $sudo apt-get install build-essential Check GCC version Confirm your installation by checking for GCC version: $ gcc --version Writing first program: Following is first prog