Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin: How to actually use gcc-mingw

Tags:

gcc

cygwin

mingw

Since "gcc -mno-cygwin" does not work anymore, I was looking for a way to get a MinGW-targeted GCC running within my Cygwin environment. (Running a MSYS environment is not an option at this point.)

The Cygwin installer offers a package "gcc-mingw", which installs, among others:

lib/gcc/i686-pc-mingw32/3.4.4/cc1.exe lib/gcc/i686-pc-mingw32/3.4.4/collect2.exe lib/gcc/i686-pc-mingw32/3.4.4/crtbegin.o lib/gcc/i686-pc-mingw32/3.4.4/crtend.o 

What is absent is the "gcc" frontend. So, how do I actually invoke this compiler? I hopefully don't have to go through "cc1" manually, have I?

I googled, but couldn't find anything relevant on the subject...

like image 906
DevSolar Avatar asked Sep 23 '10 07:09

DevSolar


1 Answers

As you already found, you can use gcc-3 with -mno-cygwin. The other possibility is to install the 32-bit and/or 64-bit toolchains from the MinGW-w64 project, which have been packaged for Cygwin very recently and hence are available through setup.exe now. Don't be put off by the rather confusing executable names: i686-w64-mingw32-gcc is the 32-bit compiler and x86_64-w64-mingw32-gcc is the 64-bit one.

like image 58
ak2 Avatar answered Sep 29 '22 11:09

ak2