I installed libportaudio using Homebrew on OS X. The install succeeded and I verified there were symlinks to the actual headers and libraries in /usr/local/include and /usr/local/lib.
However, I am now trying to make a Rustlang binding (https://github.com/JeremyLetang/rust-portaudio) that uses the libraries. It fails with the following error:
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'target/libportaudio.dylib' 'target/portaudio.o' '-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a' 'target/portaudio.metadata.o' '-nodefaultlibs' '-fno-lto' '-Wl,-dead_strip' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lstd-4e7c5e5c' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lsync-4e7c5e5c' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lrustrt-4e7c5e5c' '-L' 'target/deps' '-L' '/Users/drasa/repo/rust-portaudio/.rust' '-L' '/Users/drasa/repo/rust-portaudio' '-lportaudio' '-lSystem' '-lpthread' '-lc' '-lm' '-dynamiclib' '-Wl,-dylib' '-lcompiler-rt'
note: ld: warning: directory not found for option '-L/Users/drasa/repo/rust-portaudio/.rust'
ld: library not found for -lportaudio
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
So, it seems that cc doesn't search libraries from prefix /usr/local. Is this supposed to be so? How can I change that? Are homebrew-installed libraries supposed to work out of the box?