Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running gcc in cygwin

Tags:

gcc

cygwin

I have installed Cygwin on my system. But when I try to use the gcc command it says:

bash: gcc: command not found

Can anyone provide me the solution, please?

like image 803
siri Avatar asked Jun 04 '10 11:06

siri


People also ask

How do I get gcc in Cygwin?

To get the Cygwin installer, go to the Cygwin install web page: https://cygwin.com/install.html. You need to download the setup-x86_64.exe file, see the figure 1 for it's location within the download page. Download and run the setup-x86_64.exe file.

Can MinGW and Cygwin coexist?

Operation Modes. The MSYS2 and CYGWIN can be used with different operation modes: You can use them together with MinGW to build Windows-native software. You can use them together with any other compiler to build Windows-native software, even with Visual Studio.


2 Answers

In my installation there was no generic gcc command either, so I made a symlink for it:

cd /usr/bin
ln -s i686-pc-cygwin-gcc-3.4.4.exe gcc

Now check if it worked by doing which gcc which should give you /usr/bin/gcc and then gcc should give you gcc: no input files. Note that your version of i686-pc-cygwin-gcc-3.4.4.exe may be different. Check in /usr/bin for it.

like image 87
jlbenc Avatar answered Oct 20 '22 15:10

jlbenc


Maybe during installation of Cygwin you have not selected gcc, gdb and make packages.

I had the same problem and it was resolved after I selected above-mentioned packages.

like image 4
Dharmesh Avatar answered Oct 20 '22 17:10

Dharmesh