Resolving GCC command not found errors in Bash
The GNU Compiler Collection, also known as GCC, includes compilers and development tools for Linux, Windows, and other operating systems.
This article will discuss installing GCC and resolving errors in Linux Bash bash: gcc: command not found
.
You can use the GCC tool to compile programs written in languages such as C. If you receive an error when using this command bash: gcc: command not found
, the GCC tool is not installed correctly.
The rest of this article explains how to download the GCC tools.
Installing GCC tools for Linux
Use the following commands to install GCC tools on different operating systems.
For Arch Linux/Manjaro
Install the entire package, including the GCC tools.
sudo pacman -S base-devel
Alternatively, you can install just the GCC package.
sudo pacman -S gcc
For Ubuntu
Install the entire package, including the GCC tools.
sudo apt install build-essential
Alternatively, you can install just the GCC package.
sudo apt install gcc
Installing GCC Tools for Cygwin
First, you need to download it from here Cygwin setup-x86_64.exe
and launch it.
Press the Next button until you see the Cygwin Installation - Select Packages box and make settings, such as selecting the desired root directory for the installation.
Type in the Search box gcc
, find the package in the Package column of the list gcc-core
, and change the combo box in the New column from Skip to the GCC version.
After clicking the Next button, you will see Cygwin Installation - Review and confirm changes
the dialog. If you notice gcc-core
other packages besides , you can leave them unchanged, but make sure gcc-core
appears in the list of changes.
If you still get the error after installing bash: gcc: command not found
, ;C:\cygwin64\bin
add to your PATH environment variable.
You can successfully install the GCC tools using the one that works best for you among these options. To check the installation, check the version of the tools.
gcc --version
If you can view the version information correctly, you can use gcc
the command to compile the code file.
For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.
Related Articles
Run batch (.bat) files in CMD
Publish Date:2025/03/20 Views:155 Category:OPERATING SYSTEM
-
This article will show you how to use CMD to run a batch file.bat. There are three ways to run a batch file. Let us discuss them in the following sections. Run batch (.bat) files in CMD by directly clicking on them This way you can just go
Changing CMD text color using batch script
Publish Date:2025/03/20 Views:171 Category:OPERATING SYSTEM
-
This article will first discuss the basic concepts of batch scripts or batch files. After introducing the Batch script, let's discuss how to use the Batch script to change the text color of CMD every second. Batch script or file A batch scr
Batch set command timeout
Publish Date:2025/03/20 Views:50 Category:OPERATING SYSTEM
-
This article will first discuss the concept of timeout command in batch scripting. After that, we will discuss setting timeout command for any other command. Timeout command in batch script A timeout is a utility that pauses or delays for a
Batch merge XML files
Publish Date:2025/03/20 Views:101 Category:OPERATING SYSTEM
-
This article will first discuss and understand the XML file format. After that, we will discuss merging two or more XML files into one file using batch commands and scripts. XML File XML, also known as Extensible Markup Language, is a marku
Run .exe file from command prompt using batch script
Publish Date:2025/03/20 Views:76 Category:OPERATING SYSTEM
-
This article will show you how to use a batch (.bat) script to run a .exe type file. You can use two different commands to achieve this. Let’s discuss each method in the following sections. Run .exe file from command prompt using title an
Deleting files older than N days using batch script
Publish Date:2025/03/20 Views:57 Category:OPERATING SYSTEM
-
In this article, we will use a batch script to delete files older than N days. Deleting files older than N days using batch script The general format of the code to perform this task is shown below. FORFILES /p "D:\DIRECTORY" /S /M *.* /D -
Deleting files using batch script
Publish Date:2025/03/20 Views:178 Category:OPERATING SYSTEM
-
This article will demonstrate how to delete files using a batch script. Deleting files using batch script Generally, we can easily delete files by clicking on delete or pressing the delete button on the keyboard. But in Batch, we have to fo
Concatenate multiple files using batch script
Publish Date:2025/03/20 Views:195 Category:OPERATING SYSTEM
-
In this article, we will see how to concatenate multiple files into one file. Concatenate multiple files using batch script The general format of the commands we will use is shown below. type FileONE.txt FileTWO.txt ConcatFile.txt There are
Check if a file exists using batch processing
Publish Date:2025/03/20 Views:100 Category:OPERATING SYSTEM
-
This article will demonstrate how to use a batch script to check if a file exists through sample code. Check if a file exists using batch script The general format or syntax of the code to check if a file exists is provided below. IF EXIST