g3n/g3nd

error when build on windows

lanybass opened this issue · 4 comments

linux cross-compile .exe is OK
but on windows, build with mingw, there is an error ::

D:\Go\GOPATH\src\github.com\g3n\g3nd>go build

github.com/g3n/engine/text

..\engine\text\font.go:204: undefined: font.Metrics
..\engine\text\font.go:207: f.face.Metrics undefined (type font.Face has no field or method Metrics)

D:\Go\GOPATH\src\github.com\g3n\g3nd>go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\GO\GOPATH
set GORACE=
set GOROOT=D:\Go
set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build917696419=/tmp/go-build -gno-record-g
cc-switches
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2

I really like this project~ it's nice~

The undefined symbols should be defined in an external package dependency:
golang.org/x/image, specifically golang.org/x/image/font.

Is it possible that for some reason this package was not properly installed or is an old version ?
Try to remove it and then get g3nd again.

>rmdir /S <GOPATH>\src\golang.org\x\image
>go get github.com/g3n/g3nd

Hey, lanybass, would you mind detailing the steps you used to cross compile this for windows while on linux? I'm trying to do the same thing, but running into errors about no source files to compile for gl.

Thanks!

@jameycribbs I have seen "no source files" error, do like this:

  1. try switch GOARCH between amd64 and 386
  2. set CGO_ENABLE=1

It's ok Now~~
My fault. Just update my golang.org/x/image/font checkout. Run go get -u golang.org/x/image/font