windowsgogccgccgo

Cannot install gccgo on windows 10


I want to install gccgo, but I am on windows. I read the Setting up and using gccgo page on the golang page. The page said

The simplest way to install gccgo is to install a GCC binary release built to include Go support. GCC binary releases are available from various websites and are typically included as part of GNU/Linux distributions. We expect that most people who build these binaries will include Go support.

When i went to that page, I saw that windows had two methods of installing. I has used mingw before so I tried gcc testfile.go in my powershell terminal, but it said:

gcc.exe: error: testfile.go.go: Go compiler not installed on this system

I then tried to install the other compiler: Cygwin. I followed this tutorial, but it also yielded the exact same result.

Does anyone know how to install gccgo on windows (10)?

I also tried Installing from source, but there was no makefile. (I navigated to GCC/gcc/go and could not find a makefile, instead finding a Make-lang.in)

EDIT: I also went into GCC/libgo, but i could not find a makefile there either. I instead found Makefile.in, and Makefile.am. I found this post about Makefile.in and Makefile.am. I ran configure, but it said

Program 'configure' failed to run: No application is associated with the specified file for this operationAt line:1 char:1
+ configure
+ ~~~~~~~~~.
At line:1 char:1
+ configure
+ ~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

EDIT 2: I tried doing it in the MinGW terminal (going to C:/GCC/libgo running configure, then make), but I got the following error

./sysinfo.c:17:10: fatal error: ucontext.h: No such file or directory
   17 | #include <ucontext.h>
      |          ^~~~~~~~~~~~

Also, when looking through the source code of sysinfo.c, I found a lot #includes starting with <linux/somedir>, but (as i said before) I am using windows


Solution

  • A possible answer is WSL(Windows Subsystem for Linux).

    I tried gcc-go for you, my env is wsl(Arch): enter image description here