gpt4 book ai didi

windows - 无法在Windows 10上安装gccgo

转载 作者:行者123 更新时间:2023-12-01 22:12:01 54 4
gpt4 key购买 nike

我想安装gccgo,但是我在Windows上。我在golang页面上阅读了Setting up and using gccgo页面。页面说

安装gccgo的最简单方法是安装构建为包含Go支持的GCC二进制发行版。 GCC二进制发行版可从various websites获得,通常包含在GNU / Linux发行版中。我们希望大多数构建这些二进制文件的人将包括Go支持。

当我转到该页面时,我看到Windows有两种安装方法。我之前使用过mingw,所以我在Powershell终端中尝试了gcc testfile.go,但是它说:

gcc.exe: error: testfile.go.go: Go compiler not installed on this system
然后,我尝试安装另一个编译器: Cygwin。我遵循了 this教程,但也得到了完全相同的结果。
有谁知道如何在Windows(10)上安装gccgo?
我也尝试了 Installing from source,但是没有makefile。 (我导航到GCC / gcc / go,但找不到Makefile,而是找到了Make-lang.in)
编辑:
我也进入了GCC / libgo,但是我也找不到一个makefile。相反,我找到了Makefile.in和Makefile.am。我发现有关Makefile.in和Makefile.am的 this帖子。我运行了 configure,但它说
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
编辑2:
我尝试在MinGW终端中执行此操作(转到C:/ GCC / libgo,运行configure,然后进行make),但是出现以下错误
./sysinfo.c:17:10: fatal error: ucontext.h: No such file or directory
17 | #include <ucontext.h>
| ^~~~~~~~~~~~
另外,在查看sysinfo.c的源代码时,我发现很多 #includes<linux/somedir>开头,但是(如我之前所说)我正在使用Windows

最佳答案

可能的答案是WSL(Linux的Windows子系统)。
我为您尝试了gcc-go,我的环境是wsl(Arch):
enter image description here

关于windows - 无法在Windows 10上安装gccgo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63046295/

54 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com