os:windows10
工具:goland
语言:go1.20.4
在goland中使用go build编译一段程序,一开始报错:
# runtime/cgo
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%
随后安装了gcc8.1.0:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/Program\ Files/mingw-w64/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../
Thread model: posix
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
随后编译报错:
# github.com/gen2brain/go-unarr/unarrc
In file included from ..\..\..\github.com\gen2brain\go-unarr\unarrc\zip_inflate.go:4:
..\..\..\github.com\gen2brain\go-unarr\unarrc/external/unarr/zip/inflate.c:12: warning: "__forceinline" redefined
#define __forceinline inline
In file included from C:/Program Files/mingw-w64/mingw64/x86_64-w64-mingw32/include/crtdefs.h:10,
from C:/Program Files/mingw-w64/mingw64/x86_64-w64-mingw32/include/stddef.h:7,
from C:/Program Files/mingw-w64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/stddef.h:1,
from cgo-builtin-prolog:1:
C:/Program Files/mingw-w64/mingw64/x86_64-w64-mingw32/include/_mingw.h:266: note: this is the location of the previous definition
#define __forceinline extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
请问如何解决这个编译报错的问题?本人尝试注释掉重定义的部分也没用。