Home   Class/Enum List   File List   Compound Members   C interface  

Debugging & Compiling

Debugging

If you are having problems getting RtAudio to run on your system, make sure to pass a value of true to the RtAudio::showWarnings() function (this is the default setting). A variety of warning messages will be displayed that may help in determining the problem. Also, try using the programs included in the tests directory. The program audioprobe displays the queried capabilities of all hardware devices found for all APIs compiled. When using the ALSA and JACK APIs, further information can be displayed by defining the preprocessor definition RTAUDIO_DEBUG.

Compiling

In order to compile RtAudio for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement:

OS:Audio API:C++ Class:Preprocessor Definition:Library or Framework:Example Compiler Statement:
LinuxALSARtApiAlsaLINUX_ALSAasound, pthreadg++ -Wall -D__LINUX_ALSA__ -o audioprobe audioprobe.cpp RtAudio.cpp -lasound -lpthread
LinuxPulseAudioRtApiPulseLINUX_PULSEpthreadg++ -Wall -D__LINUX_PULSE__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread -lpulse-simple -lpulse
LinuxOSSRtApiOssLINUX_OSSpthreadg++ -Wall -D__LINUX_OSS__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread
Linux or Macintosh OS-XJack Audio ServerRtApiJackUNIX_JACKjack, pthreadg++ -Wall -D__UNIX_JACK__ -o audioprobe audioprobe.cpp RtAudio.cpp $(pkg-config –cflags –libs jack) -lpthread
Macintosh OS-XCoreAudioRtApiCoreMACOSX_COREpthread, CoreAudiog++ -Wall -D__MACOSX_CORE__ -o audioprobe audioprobe.cpp RtAudio.cpp -framework CoreAudio -framework CoreFoundation -lpthread
WindowsDirectSoundRtApiDsWINDOWS_DSdsound.lib (ver. 5.0 or higher), multithreadedMinGW: g++ -Wall -D__WINDOWS_DS__ -o audioprobe audioprobe.cpp RtAudio.cpp -lole32 -lwinmm -ldsound
WindowsASIORtApiAsioWINDOWS_ASIOvarious ASIO header and source filesMinGW: g++ -Wall -D__WINDOWS_ASIO__ -Iinclude -o audioprobe audioprobe.cpp RtAudio.cpp asio.cpp asiolist.cpp asiodrivers.cpp iasiothiscallresolver.cpp -lole32
WindowsWASAPIRtApiWasapiWINDOWS_WASAPIMinGW: FunctionDiscoveryKeys_devpkey.h, lksuser, lmfplat, lmfuuid, lwmcodecdspuuid, lwinmm, lole32MinGW: g++ -Wall -D__WINDOWS_WASAPI__ -Iinclude -o audioprobe audioprobe.cpp RtAudio.cpp -lole32 -lwinmm -lksuser -lmfplat -lmfuuid -lwmcodecdspuuid

The example compiler statements above could be used to compile the audioprobe.cpp example file, assuming that audioprobe.cpp, RtAudio.h, RtAudio.cpp and any other necessary files all exist in the same directory or the include directory.


©2001-2023 Gary P. Scavone, McGill University. All Rights Reserved.
Maintained by Gary P. Scavone.