Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct package name for gcc in cygwin?

I need gcc installed on cygwin, but when I search for gcc in the cygwin setup application, I get several results with the string "gcc" in their names, for example:

cygwin32-gcc-ada
cygwin32-gcc-core
cygwin32-gcc-fortran
cygwin32-gcc-g++
cygwin32-gcc-objc++
...
gcc-ada
gcc-core
gcc-fortran
gcc-g++
...
libgcc1
minigw-gcc-core
minigw-gcc-g++
....
minigw64-i686-gcc-core
minigw64-i686-gcc-g++
...

when I am searching for gcc in synaptic in ubuntu, I have a very obvious result what am I suppose to do with these names? install all? install a random one and then create symlinks to where ever it's binary may land to /usr/bin/gcc ?

what usefulness and productivity can be achieved from these many packages names showing up when I attempt searching for that one gcc that I keep reading online that I need to build packages that aren't on cygwin installer?

everywhere I read about "install gcc on cygwin and then continue to do this and that" they never mention which of the gcc packages above is single correct one,

its like everyone everywhere somehow already knows which gcc is the correct one and that information is no where to be found online.

I would appreciate clarification and further help.

EDIT: sometime in the past, there actually used to be a package called just "gcc", I found that from the screenshots here: http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html

I can't tell how many years ago that was.

like image 885
AmazingMiki Avatar asked May 31 '14 15:05

AmazingMiki


People also ask

What is Cygwin compiler?

Cygwin (/ˈsɪɡwɪn/ SIG-win) is a POSIX-compatible programming and runtime environment that runs natively on Microsoft Windows. Under Cygwin, source code designed for Unix-like operating systems may be compiled with minimal modification and executed. Cygwin.

Can I install both Cygwin and MinGW?

You can install MinGW-W64 under "Cygwin" by selecting these packages (under "Devel" category): mingw64-x86_64-gcc-core : 64-bit C compiler for native 64-bit Windows. The executable is " x86_64-w64-mingw32-gcc ".

Which is better Cygwin or MinGW?

MinGW is higher performance than Cygwin, but it's also 32-bit which may be a problem with your applications. There is a 64-bit environment similar to MinGW but it's a different project. MinGW-w64 is in all senses the successor to MinGW.


2 Answers

The things that make Cygwin GCC packages confusing are:

  • gcc-core and cygwinXX-gcc-core are confusingly related (XX is 32 or 64 depending on your Cygwin architecture).
  • There are packages for both MinGW and MinGW-w64, which are different projects, although many people are unaware of their coexistence (I was).

As of Oct 2015, Cygwin GCC packages are broken down like this.

In Cygwin x86 (32-bit):

PROJECT: Cygwin GCC (Windows POSIX-enabled executables via linking to cygwin1.dll)

    PACKAGE                    TARGET ARCH    MAIN BINARY + LINKS (except versioned link)
    gcc-core                   x86            /usr/bin/gcc.exe
                                              /usr/bin/cc (symlink)
                                              /usr/bin/i686-pc-cygwin-gcc.exe (hard link)
    cygwin64-gcc-core          x86_64         /usr/bin/x86_64-pc-cygwin-gcc.exe

PROJECT: MinGW (Windows 32-bit standalone executables)

    PACKAGE                    TARGET ARCH    MAIN BINARY + LINKS (except versioned link)
    mingw-gcc-core             x86            /usr/bin/i686-pc-mingw32-gcc.exe

PROJECT MinGW-w64 (fork from MinGW for building 64-bit)

    PACKAGE                    TARGET ARCH    MAIN BINARY + LINKS (except versioned link)
    mingw64-i686-gcc-core      x86            /usr/bin/i686-w64-mingw32-gcc.exe
    mingw64-x86_64-gcc-core    x86_64         /usr/bin/x86_64-w64-mingw32-gcc.exe

In Cygwin x86_64 (64-bit):

PROJECT: Cygwin GCC (Windows POSIX-enabled executables via linking to cygwin1.dll)

    PACKAGE                    TARGET ARCH    MAIN BINARY + LINKS (except versioned link)
    gcc-core                   x86_64         /usr/bin/gcc.exe
                                              /usr/bin/cc (symlink)
                                              /usr/bin/x86_64-pc-cygwin-gcc.exe (hard link)
    cygwin32-gcc-core          x86            /usr/bin/i686-pc-cygwin-gcc.exe

PROJECT: MinGW (Windows 32-bit standalone executables)

    PACKAGE                    TARGET ARCH    MAIN BINARY + LINKS (except versioned link)
    mingw-gcc-core             x86            /usr/bin/i686-pc-mingw32-gcc.exe

PROJECT MinGW-w64 (fork from MinGW for building 64-bit)

    PACKAGE                    TARGET ARCH    MAIN BINARY + LINKS (except versioned link)
    mingw64-i686-gcc-core      x86            /usr/bin/i686-w64-mingw32-gcc.exe
    mingw64-x86_64-gcc-core    x86_64         /usr/bin/x86_64-w64-mingw32-gcc.exe
like image 158
André Chalella Avatar answered Oct 31 '22 02:10

André Chalella


The following are for compiling 32-bit binaries in 64-bit Cygwin:

cygwin32-gcc-ada
cygwin32-gcc-core
cygwin32-gcc-fortran
cygwin32-gcc-g++
cygwin32-gcc-objc++
...

The following are the main gcc pieces. If you don't need some of these specific languages, like Ada or Fortran, don't install them.

gcc-ada
gcc-core
gcc-fortran
...

This is a library required by gcc.

libgcc1

The mingw (not minigw...those appear to be typos) version are for compiling programs in Cygwin that do not depend on Cygwin1.dll. Programs built with these use the Microsoft C RTL, and can be installed on systems that don't have Cygwin. They also are not subject to Cygwin's rather restrictive Open Source License. The ones whose names do not contain 64-i686 are for producing 32-bit binaries, while the ones that do are for producing 64-bit binaries.

mingw-gcc-core
mingw-gcc-g++
....
mingw64-i686-gcc-core
mingw64-i686-gcc-g++

Note that you can see all of this information at http://cygwin.com/packages.

like image 29
SeeJayBee Avatar answered Oct 31 '22 03:10

SeeJayBee