使用简单的应用程序编译 rt 音频时遇到问题
#include "RtAudio.h"
int main()
{
RtAudio *audio = 0;
audio = new RtAudio;
delete audio;
return 0;
}
编译
g++ -Wall -D__MACOSX_CORE__ -o probe rtaudio.cpp RtAudio.cpp -framework CoreAudio -lpthread
错误
Undefined symbols for architecture x86_64:
"RtAudio::RtAudio(RtAudio::Api)", referenced from:
_main in rtaudio-e456a2.o
_main in RtAudio-a64f56.o
"RtAudio::~RtAudio()", referenced from:
_main in rtaudio-e456a2.o
_main in RtAudio-a64f56.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)