Unable to use portaudio with C++

63 Views Asked by At

I'm trying to use portaudio.h to record audio, I'm on VScode using C++.

#include <portaudio.h> (in my cpp file) include_directories("/Users/ellendagher/Desktop/quorum-c/portaudio/include") (in my Cmakelist.txt)

I'm sure that I downloaded it portaudio correctly using brew:

ellendagher@MacBook-Air-de-Ellen ~ % brew info portaudio ==> portaudio: stable 19.7.0 (bottled), HEAD Cross-platform library for audio I/O http://www.portaudio.com /opt/homebrew/Cellar/portaudio/19.7.0 (33 files, 560KB) * Poured from bottle using the formulae.brew.sh API on 2023-09-02 at 16:30:29 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/p/portaudio.rb License: MIT ==> Dependencies Build: pkg-config ✔ ==> Options --HEAD Install HEAD version ==> Analytics install: 3,359 (30 days), 10,022 (90 days), 23,329 (365 days) install-on-request: 2,145 (30 days), 6,653 (90 days), 15,346 (365 days) build-error: 0 (30 days)

So I'm not sure why I get this when I run my code:

ellendagher@MacBook-Air-de-Ellen quorum-c % cd "/Users/ellendagher/Desktop/quorum-c/src/" && g++ only_record_audio.cpp -o only _record_audio && "/Users/ellendagher/Desktop/quorum-c/src/"only_record_audio only_record_audio.cpp:3:10: fatal error: 'portaudio.h' file not found #include <portaudio.h> ^~~~~~~~~~~~~

Thank you

0

There are 0 best solutions below