mvdnes / portaudio-rs

PortAudio bindings for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows build error: find_library fails, portaudio-2.0 not found

CoDEmanX opened this issue · comments

I try to build a Rust project, which uses portaudio_sys. The compilation aborts because

match pkg_config::find_library("portaudio-2.0")

can't find the library ("can't find the specified file").

How do I "install" this library on Windows? Pre-compiled shared libraries are available here:
https://github.com/spatialaudio/portaudio-binaries

I'm not sure how to tell the Rust compiler to use these (if possible at all). Or do I need to build portaudio myself first?

I have removed pkgconfig on Windows. It seemed to work when placing the .dll and .lib file next to the Cargo.toml file. I needed to rename portaudio_x64.lib to portaudio.lib, but had to keep the name of the .dll the same. (I used the Visual Studio libraries)

Thanks! Can I also rename libportaudio.dylib to portaudio.lib to make it work?
I can unfortunately not test it yet, because I ran into more build issues unrelated to portaudio.

That I do not know. I am not actively using this library currently.

Figured it out: I need to place the portaudio DLL into the Rust lib folder, e.g.

C:\Program Files\Rust nightly 1.7\lib\rustlib\x86_64-pc-windows-gnu\lib

It needs to be renamed to portaudio.dll in order to make the compiler (ld.exe) find it, at least in my case (extern crate portaudio;).

Another copy needs to be placed next to the executable of the program, which will use portaudio. It needs to be called differently, depending on what name is compiled into the DLL (portaudio_x64.bit, libportaudio-x86_64-w64-mingw32.static.dll or something like that).