hybridgroup / gobot-sphero

Gobot adaptor for Sphero robot
http://gobot.io
5 stars 1 forks source link

Compilation error #2

Closed macmania closed 10 years ago

macmania commented 10 years ago

I get a compilation error when trying to build the package. Here is the gist of the error that I get when trying to install the package: https://gist.github.com/macmania/6395750b6daee2bf264c

solojavier commented 10 years ago

Hi @macmania could you provide the steps to reproduce the error? What command are you running and with what parameters? What OS do you have?

macmania commented 10 years ago

go get github.com/hybrid-group/gobot-sphero. I have a max os x 10.9.2, clang compiler: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.1.0 Thread model: posix

solojavier commented 10 years ago

What version of go are you using?

Are you able to install other packages?

macmania commented 10 years ago

Version: go version go1.2.1 darwin/386

Yes, Im having trouble installing other packages. I'm getting this error: no buildable Go source files in ~/go/github.com/macmania/golang-web-tour/src/github.com/gorilla/mux :( :( Here is my go env printout: GOARCH="386" GOBIN="" GOCHAR="8" GOEXE="" GOHOSTARCH="386" GOHOSTOS="darwin" GOOS="darwin" GOPATH=":/Users/jojofabe/workspace/go/github.com/macmania/golang-web-tour/" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_386" TERM="dumb" CC="gcc" GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread -fno-common" CXX="g++" CGO_ENABLED="1"

I have yet to find the pesky problem. :(

stewart commented 10 years ago

It looks like your system is trying to use gcc (CC="gcc") instead of Clang. Additionally, your GOPATH is oddly scoped

Here's the results of go env on my system:

GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/stewart/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.2.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.2.2/libexec/pkg/tool/darwin_amd64"
TERM="dumb"
CC="clang"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common"
CXX="clang++"
CGO_ENABLED="1"

Hope this helps you narrow down what's wrong.

macmania commented 10 years ago

Thanks you guys! I'll try this later tonight.

solojavier commented 10 years ago

How did you install go? This is the official guide: http://golang.org/doc/install#osx , I also found some places where they recommend uninstalling and installing with brew to solve this error...

macmania commented 10 years ago

thanks @solojavier and @stewart! So here's another error I'm getting:

github.com/tarm/goserial

/var/folders/s8/nfxndcg51gn4rd12wg3j2cy00000gn/T/go-build713879582/github.com/tarm/goserial/_obj/serial_posix.cgo1.go:5: package statement must be first I fixed these pesky env variables (yay!) and now it builds and compiles libraries :). I installed go i believe through a .dmg. Thanks again for the help guys!

solojavier commented 10 years ago

Good to hear, when are you getting this new error?

macmania commented 10 years ago

After I've changed the environment variables and installed the gosphero pkg.