go-enet icon indicating copy to clipboard operation
go-enet copied to clipboard

Builds fail in Windows 11

Open matzi8qr opened this issue 1 year ago • 6 comments
trafficstars

Trying to build example code in the readme, and it is refusing to build. Are you sure there are no dependencies for Windows machines?

image

matzi8qr avatar Dec 06 '23 21:12 matzi8qr

Do you have the imports at the top? Also did you make sure the module is actually in go.mod?

codecat avatar Dec 06 '23 21:12 codecat

Yep! Line 4 in server.go: import "github.com/codecat/go-enet" Line 7 In go.mod, require github.com/codecat/go-enet v0.0.0-20230124183417-a8586e7e37c4 (built by Goland)

My professor was able to build it on both of his unix machines without issue.

matzi8qr avatar Dec 06 '23 23:12 matzi8qr

More info failure occurs on Windows 11 Go 1.21

jsantore avatar Dec 06 '23 23:12 jsantore

I have the exact same issue on Windows 10 Go version 1.21.6.

Jldevictoria avatar Apr 05 '24 02:04 Jldevictoria

@matzi8qr @jsantore

I was able to get past this today by making sure gcc was in my Windows path. I had removed my old version of msys64 and installed a new version in a different path, so gcc was not reachable by the go build tools. Adding my msys64 bin directory to my PATH variable got me through this compile issue. Give it a shot.

Jldevictoria avatar Apr 05 '24 04:04 Jldevictoria

~~I've added msys64 to my path, and gcc is accessible in the terminal. Still gives the same error on go run~~

Scratch that, I'm just bad. Turns out I had the wrong directory in my PATH which pointed to an empty script. Make sure to actually install gcc via the MSYS2 Pacman, and then add the ucrt64\bin to your path.

Once I did that, as @Jldevictoria noted, it works fine

warent avatar Jul 03 '24 00:07 warent