xlab / vorbis-go

Package vorbis provides Go bindings for OggVorbis implementation by the Xiph.Org Foundation.
26 stars 7 forks source link

Build under Windows fails in CGO #7

Closed drunlade closed 4 years ago

drunlade commented 4 years ago

I've been trying to get this to work in a Windows env, but having no luck due to cgo related issues, that to be honest I don't understand. Is there a specific set of "things" I need do to make it work, or is it just not windows compatible?

CGO_ENABLED=1 go build
# github.com/xlab/vorbis-go/vorbis
C:\msys64\tmp\go-build495879250\b134\_x005.o: In function `_cgo_111d3499b692_Cfunc_ogg_stream_iovecin':
/tmp/go-build495879250/b134/cgo-gcc-prolog:371: undefined reference to `ogg_stream_iovecin'
/tmp/go-build495879250/b134/cgo-gcc-prolog:371:(.text+0x36b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `ogg_stream_iovecin'
collect2: error: ld returned 1 exit status
go: failed to remove work dir: GetFileInformationByHandle C:\msys64\tmp\go-build495879250\NUL: Incorrect function.
xlab commented 4 years ago

Hi, just make sure that your distribution of libogg has the same version and compatibility as the headers from these bindings.

Seems that this function is missing from your .dlls: https://xiph.org/ogg/doc/libogg/ogg_stream_iovecin.html

Or .dll is not compatible with MINGW64 arch.

drunlade commented 4 years ago

Thanks, I'll recheck my libs and headers. I tried to make sure I got the right everything, but you never know! CGO anything is often a bit of a minefield when it come to multi-platform.

drunlade commented 4 years ago

Closing this, made some progress but still failed, resorted to use Go ffmpeg bindings since I have them working already. Utterly overkill, but if it works it works.