Closed Aidan-OS closed 2 years ago
Hi Aidan,
I'm not using Windows but maybe I can help.
Is there not a way to install a pre-compiled PortAudio on MinGW? I see there are some package managers, but I don't know if there is a package for PortAudio.
I suspect you're missing a portaudio-2.0.pc
file for pkg-config. Mine (on macOS) exists at /usr/local/lib/pkgconfig/portaudio-2.0.pc
. I suppose /usr/local/lib/pkgconfig/
is the default path and doesn't need to be added to PKG_CONFIG_PATH
. It looks like this file is generated (from this) when you build PortAudio; otherwise you'll need to write it yourself.
You can run pkg-config portaudio-2.0 --libs --cflags
to check whether the .pc
file is found.
When looking at the file mentioned here I find that line 16 is contained in a multi line comment, so the fact that it is complaining makes no sense to me.
This is how cgo works: A magic comment preceding the import of pseudo-package C
.
Hi Aidan,
Msys2 provides MinGW + Pacman, the Arch Package Manager. Through Pacman you can install most libraries, incl. portAudio.
Another option for running gcc on Windows is tdm-gcc. I also made good experience with tdm-gcc compiling cgo projects natively on Windows hosts.
For cross-compiling, feel free to fork and adjust remoteAudio-xcompile to your needs.
I am having the exact same issue. I've added the location to the PKG_CONFIG_PATH but there's no difference
I believe this issue was solved by @dh1tw's suggestion. If not, please re-open.
I eventually tried to do this myself and ran into the same problem as @Raraku.
Getting this error:
$ go build .
# pkg-config --cflags -- portaudio-2.0
Package portaudio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `portaudio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'portaudio-2.0', required by 'virtual:world', not found
pkg-config: exit status 1
in spite of this working as expected:
$ pkg-config --cflags -- portaudio-2.0
-IC:/msys64/mingw64/include
I was able to solve the problem by installing mingw-w64-x86_64-pkg-config
:
pacman -S mingw-w64-x86_64-pkg-config
I have no idea why the pre-installed pkg-config did not work as expected.
Hi,
I am trying to attach to audio streams on windows with go and have found many sources pointing to this package but I am having issues when running the
go get
command. Here are the steps I have taken so far:PKG_CONFIG_PATH
environment variablego get github.com/gordonklaus/portaudio
When I run the final command I get this error:
When looking at the file mentioned here I find that line 16 is contained in a multi line comment, so the fact that it is complaining makes no sense to me. Is there something that I have done wrong?