gnewton / chidley

Convert XML to Go structs / XML to JSON
Apache License 2.0
274 stars 35 forks source link

Unable to build on Debian or OSX #32

Closed mountainerd closed 6 years ago

mountainerd commented 6 years ago

When attempting to build Chidley, the following error is output for me:

chidley-master laptop$ GOOS=darwin GOARCH=amd64 go build chidley.go
# command-line-arguments
./chidley.go:218:29: undefined: Node
./chidley.go:218:105: undefined: FQN
./chidley.go:252:43: undefined: FQN
./chidley.go:300:79: undefined: Source
./chidley.go:367:29: undefined: Node
./chidley.go:367:70: undefined: FQN
./chidley.go:367:79: undefined: XMLType
./chidley.go:390:34: undefined: Node
./chidley.go:398:27: undefined: PrintGoStructVisitor
./chidley.go:419:34: undefined: PrintGoStructVisitor
./chidley.go:419:34: too many errors

Some potential helpful information regarding environment:

laptop$ go version
go version go1.10 darwin/amd64
laptop$
laptop$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/laptop/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/laptop/Development/Go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/41/jf6b3x3d63q5w5my6h16q_f80000gq/T/go-build296077778=/tmp/go-build -gno-record-gcc-switches -fno-common"
gnewton commented 6 years ago

Hello, :-)

You are not building correctly.

Instead of go build chidley.go just do go build

This compiles all files in the directory and will build the chidley executable.

Thanks, Glen

Reference: https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies

mountainerd commented 6 years ago

Well, ain't that a kick in the pants. Layer 8 issue. Sorry for the nuisance ticket and thanks for gently calling me a moron! :) 👍

gnewton commented 6 years ago

No worries! :-)