librespot-golang icon indicating copy to clipboard operation
librespot-golang copied to clipboard

First run issue

Open KiSa04 opened this issue 1 year ago • 2 comments

I'm currently trying to run librespot-golang for the first time, but I'm getting these errors after go run main.go

# github.com/xlab/vorbis-go/decoder ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:28:19: undefined: vorbis.OggSyncState ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:31:21: undefined: vorbis.OggStreamState ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:35:14: undefined: vorbis.OggPage ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:39:16: undefined: vorbis.OggPacket ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:42:14: undefined: vorbis.Info ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:45:17: undefined: vorbis.Comment ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:49:18: undefined: vorbis.DspState ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\decoder.go:54:15: undefined: vorbis.Block ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\util.go:11:26: undefined: vorbis.Info ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\util.go:11:43: undefined: vorbis.Comment ..\..\..\go\pkg\mod\github.com\xlab\[email protected]\decoder\util.go:11:43: too many errors

KiSa04 avatar Dec 08 '23 01:12 KiSa04

I had the same issue, you can fix it by enabled CGO Here is a dockerfile i use

FROM golang:1.22-alpine3.19

WORKDIR /app

RUN apk add vim git bash
RUN apk add pkgconfig portaudio-dev # Needed to get PortAudio-go
RUN apk add gcc g++ # Needed for CGO
RUN apk add libvorbis libvorbis-dev libogg libogg-dev # Needed OGG Lib

ENV CGO_ENABLED = 1

RUN go install github.com/cosmtrek/air@latest

ENTRYPOINT ["air","-c",".air.toml"]

Xantios avatar May 10 '24 13:05 Xantios