[GH-ISSUE #26] undefined reference to `ogg_stream_iovecin' #19

Closed
opened 2026-02-28 14:24:44 +03:00 by kerem · 1 comment
Owner

Originally created by @AndreKR on GitHub (Apr 2, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/26

To get somewhere with the build, I took these steps first:

  • Removed my existing installation of MinGW-w64.
  • Installed MSYS2 (in c:\dev\tools\msys64).
  • Ran pacman -S pacman -S mingw-w64-ucrt-x86_64-gcc.
  • Added c:\dev\tools\msys64\ucrt64\bin to the PATH.
  • Ran pacman -S mingw-w64-ucrt-x86_64-pkg-config
  • Ran pacman -S mingw-w64-ucrt-x86_64-libogg
  • Ran pacman -S mingw-w64-ucrt-x86_64-libvorbis
  • Set an envvar PKG_CONFIG_PATH=c:\dev\tools\msys64\ucrt64\lib\pkgconfig.

Then I had to add two new functions to output/driver_windows.go to satisfy the interface:

func (out *output) Drop() error { return nil }
func (out *output) DelayMs() (int64, error) { return 0, nil }

But now I get:

C:/dev/tools/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\andre\AppData\Local\Temp\go-link-407401969\000013.o: in function `_cgo_fb2c7143e03b_Cfunc_ogg_stream_iovecin':
/tmp/go-build/vorbis.cgo2.c:371:(.text+0x35b): undefined reference to `ogg_stream_iovecin'
collect2.exe: error: ld returned 1 exit status

Famously CGO is not Go, and I have no idea what this error even means.

Originally created by @AndreKR on GitHub (Apr 2, 2024). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/26 To get somewhere with the build, I took these steps first: * Removed my existing installation of MinGW-w64. * Installed MSYS2 (in `c:\dev\tools\msys64`). * Ran `pacman -S pacman -S mingw-w64-ucrt-x86_64-gcc`. * Added `c:\dev\tools\msys64\ucrt64\bin` to the PATH. * Ran `pacman -S mingw-w64-ucrt-x86_64-pkg-config` * Ran `pacman -S mingw-w64-ucrt-x86_64-libogg` * Ran `pacman -S mingw-w64-ucrt-x86_64-libvorbis` * Set an envvar `PKG_CONFIG_PATH=c:\dev\tools\msys64\ucrt64\lib\pkgconfig`. Then I had to add two new functions to `output/driver_windows.go` to satisfy the interface: ``` func (out *output) Drop() error { return nil } func (out *output) DelayMs() (int64, error) { return 0, nil } ``` But now I get: ``` C:/dev/tools/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\andre\AppData\Local\Temp\go-link-407401969\000013.o: in function `_cgo_fb2c7143e03b_Cfunc_ogg_stream_iovecin': /tmp/go-build/vorbis.cgo2.c:371:(.text+0x35b): undefined reference to `ogg_stream_iovecin' collect2.exe: error: ld returned 1 exit status ``` Famously CGO is not Go, and I have no idea what this error even means.
kerem closed this issue 2026-02-28 14:24:44 +03:00
Author
Owner

@devgianlu commented on GitHub (Apr 3, 2024):

To build Windows I've been using a Docker container because that seemed like the easiest way. I have updated https://github.com/devgianlu/go-librespot/pull/4 with the build instructions. I have also rebased on master to fix the missing functions so you may need to git reset.

<!-- gh-comment-id:2034608904 --> @devgianlu commented on GitHub (Apr 3, 2024): To build Windows I've been using a Docker container because that seemed like the easiest way. I have updated https://github.com/devgianlu/go-librespot/pull/4 with the build instructions. I have also rebased on master to fix the missing functions so you may need to git reset.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#19
No description provided.