g3n / engine

Go 3D Game Engine (http://g3n.rocks)
https://discord.gg/NfaeVr8zDg
BSD 2-Clause "Simplified" License
2.8k stars 295 forks source link

windoze - setup. #36

Closed ghost closed 5 years ago

ghost commented 6 years ago

I cant seem to get it setup for windows. I am a mac person normally. heres where i am:

gedw9@DESKTOP-6Q0VG3G MINGW64 /c
$ go get -u github.com/g3n/engine/...
# github.com/g3n/engine/audio/al
exec: "gcc": executable file not found in %PATH%
# github.com/g3n/engine/audio/ov
exec: "gcc": executable file not found in %PATH%
# github.com/g3n/engine/gls
exec: "gcc": executable file not found in %PATH%
# github.com/g3n/engine/audio/vorbis
exec: "gcc": executable file not found in %PATH%
# github.com/go-gl/glfw/v3.2/glfw
exec: "gcc": executable file not found in %PATH%

I have git for windows installed and this seems to also setup the ming64 env for me. Its gotten alot better lately.

But i dont have make or its gcc, etc

did some googling but i got completely confused..

On windows i actually use mage, which is a pure golang replacement for make. On windows i do:

go get github.com/magefile/mage
go get github.com/golang/dep/cmd/dep
go get github.com/mattn/goveralls
go get -u github.com/jteeuwen/go-bindata/...

then you can call mage blah, just like your woudl make blah. anyway..

vasilevp commented 6 years ago

From the cgo wiki entry:

In order to use cgo on Windows, you'll also need to first install a gcc compiler (for instance, mingw-w64) and have gcc.exe (etc.) in your PATH environment variable before compiling with cgo will work.

Git alone may not be enough since there's no real need for them to ship a gcc toolchain, and my guess is that they don't. I'd try using a full Mingw or Cygwin package.

Make sure you're running a mingw-aware terminal or just add your \bin (or any other directory where gcc.exe is) to PATH (in Control Panel -> System -> Environment Variables or the cmd way: set PATH=%PATH%;<mingw_path>\bin).

ghost commented 6 years ago

@exploser thanks for the in-depth instructions - thats a huge help.