Install GCC in Ubuntu
1. First check if you have gcc installed with command
gcc --version
2. If gcc is installed it will display the version else it will give you the command to install gcc
sudo apt install gcc
3. Now execute the command ‘sudo apt install gcc’ and it will proceed as shown:
4. Select ‘Y’ to continue, it will proceed as shown:
5. If everything goes fine it will be completed as:
6. Now you can check whether gcc is installed successfully with command gcc –version. It will give
the details of version installed.
7. Now you have successfully installed gcc and you are ready to compile your C programs.
Compile and Run C Program
1. Use a text editor to write the C source code.
For example, type the command below command to create the file hello.c
gedit hello.c
It will open empty file with name hello.c for you to enter the source code.
2. Now enter the C source code below:
3. Close the editor window
4. Compile the program with below command:
gcc hello.c -o hello
This command will invoke the GNU C compiler to compile the file hello.c and output (-o) the
result to an executable called hello.
5. Now execute the program with below command:
./hello
This should result in the output
Hello World
__________________________________________
How to Install GCC Compiler on Ubuntu 20.04
The GNU Compiler Collection (GCC) is a collection of compilers and libraries for C, C++, Objective-C, Fortran, Ada, Go , and D programming languages. Many open-source projects, including the GNU tools and the Linux kernel, are compiled with GCC.
This tutorial covers the steps required to install the GCC compiler on Ubuntu 20.04. We will show you how to install the distro stable version and the latest version of GCC.
The same instructions apply for Ubuntu 18.04 and any Ubuntu-based distribution, including Kubuntu, Linux Mint and Elementary OS.
Prerequisites
To be able to add new repositories and install packages on your Ubuntu system, you must be logged in as root or user with sudo privileges .
Installing GCC on Ubuntu
The default Ubuntu repositories contain a meta-package named build-essential that contains the GCC compiler and a lot of libraries and other utilities required for compiling software.
Conclusion
You have successfully installed GCC on your Ubuntu 20.04. You can now visit the official GCC Documentation page and learn how to use GCC and G++ to compile your C and C++ programs.
If you hit a problem or have feedback, leave a comment below.
__________________________________________
Reference:
https://linuxize.com/post/how-to-install-gcc-compiler-on-ubuntu-18-04/
__________________________________________
Subscribe to us:
https://www.youtube.com/channel/UCV28...
__________________________________________
Ignore Tags:
#VMware #gccCompiler #C #C++ #programming #language #ubuntu #linux
__________________________________________
NINJA co.™
🔥 | Learn Something New Everyday 🔥
🚀 | Full-stack • MERN • Development
💻 | Python • Java • C • C++
🧠 | Linux 🐧
📊 | AI • ML • Data Science 👨💻💯 & more.
__________________________________________
The Future is Now!
Passionate about Technology | Marketing | AI
Tricks of the Internet
Programmer💻👨💻🧠💡🔥
| 💻 | #programminglanguages
| 💻 | #fullstackdeveloper
| 👩💻 | #merndeveloper
| 👩💻 | #softwareengineering
| 📈 | #datascience
| 🤖 | #machinelearning
| 🧠 | #artificialintelligence
| 📊 | #deeplearning
| 👩💻 | #datascientist
__________________________________________
🔥 Sharing Quality Content Daily
🔍 Programming | What Is | How-To
📚 Only Knowledge
__________________________________________
📩 DM for Business/Queries
🔥 Important links: Discord | YouTube | Facebook | Instagram👇
https://linktr.ee/Ninja_Corp
Support the stream:
https://streamlabs.com/ninjaprogrammerco
Copyright © 2020 NINJA Co. All rights reserved.