beep icon indicating copy to clipboard operation
beep copied to clipboard

Unable to build in linux - undefined: driver in [email protected]

Open stjohnjohnson opened this issue 4 years ago • 3 comments

I've been using your library pretty successfully on OSX, but when I tried to cross compile for Linux I ran into the following error on build:

$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build
# github.com/hajimehoshi/oto
/go/pkg/mod/github.com/hajimehoshi/[email protected]/context.go:120:18: undefined: driver

I tried to make the most minimal example and found it with the 1-hello-world/a tutorial. Here is a reproduction gist that will run it both locally and in the golang:1.13 container.

$ make
Running locally
GOOS=linux GOARCH=amd64 go build
# github.com/hajimehoshi/oto
../../go/pkg/mod/github.com/hajimehoshi/[email protected]/context.go:120:18: undefined: driver
make[1]: *** [local] Error 2
make: [default] Error 2 (ignored)
Running in Docker
docker run --rm -v`pwd`:/src -w /src -e CGO_ENABLED=0 golang:1.13 go build
go: downloading github.com/faiface/beep v1.0.2
go: extracting github.com/faiface/beep v1.0.2
go: downloading github.com/hajimehoshi/oto v0.3.1
go: downloading github.com/pkg/errors v0.8.1
go: downloading github.com/hajimehoshi/go-mp3 v0.1.1
go: extracting github.com/pkg/errors v0.8.1
go: extracting github.com/hajimehoshi/oto v0.3.1
go: extracting github.com/hajimehoshi/go-mp3 v0.1.1
go: finding github.com/faiface/beep v1.0.2
go: finding github.com/hajimehoshi/oto v0.3.1
go: finding github.com/hajimehoshi/go-mp3 v0.1.1
go: finding github.com/pkg/errors v0.8.1
# github.com/hajimehoshi/oto
/go/pkg/mod/github.com/hajimehoshi/[email protected]/context.go:120:18: undefined: driver
make[1]: *** [docker] Error 2
make: [default] Error 2 (ignored)

stjohnjohnson avatar Dec 09 '19 04:12 stjohnjohnson

Can you tell me which version of OSX you're running? I'm finding the OpenAL deprecation in 10.15 breaking oto (which breaks beep).

dericmiller avatar Jan 01 '20 20:01 dericmiller

Sorry for the delay, OSX Catalina - 10.15.2 (19C57)

stjohnjohnson avatar Jan 11 '20 22:01 stjohnjohnson

Same issue here with Ubuntu 18.04

It happens only inside "make".

GOARCH=amd64 go build -ldflags='-s -w -X main.Version=2.0.0 -X main.BuildTime=2020-03-04T13:43:16+0100' -o builds/bin/2.0.0/ex .; else GOARCH=amd64 GOARM=7 go build -ldflags=-s -w -X main.Version=2.0.0 -X main.BuildTime=2020-03-04T13:43:16+0100 -o builds/bin/2.0.0/cyclops_amd64v7 .

This works outside make, but if I try to build it from a makefile I get: github.com/hajimehoshi/oto ../../../../pkg/mod/github.com/hajimehoshi/[email protected]/context.go:120:18: undefined: driver

samuelebistoletti avatar Mar 04 '20 12:03 samuelebistoletti