我正在尝试同时使用RtAudio和RtMidi。我在同一个文件夹中有RtAudio.cpp,RtAudio.h,RtHelper.h,RtMidi.cpp和RtMidi.h,还有两个测试程序,midiprobe.cpp和audioprobe.cpp。
使用default command编译midiprobe是可行的,但是当我尝试对audioprobe执行同样的操作来测试RtAudio时,我得到了错误信息。
下面是我用来编译的代码:
g++ -Wall -D__MACOSX_CORE__ -o audioprobe audioprobe.cpp RtAudio.cpp -framework CoreAudio -lpthread以下是错误:
Undefined symbols for architecture x86_64:
"_CFRelease", referenced from:
RtApiCore::getDeviceInfo(unsigned int)in cc89M9Ki.o
"_CFStringGetCString", referenced from:
RtApiCore::getDeviceInfo(unsigned int)in cc89M9Ki.o
"_CFStringGetLength", referenced from:
RtApiCore::getDeviceInfo(unsigned int)in cc89M9Ki.o
"_CFStringGetSystemEncoding", referenced from:
RtApiCore::getDeviceInfo(unsigned int)in cc89M9Ki.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status我对这类东西非常陌生(到目前为止大部分都有现成的框架),还不能弄清楚这一点。因为这是默认的例子,我真的不知道下一步该怎么做……在进阶时谢谢。
发布于 2012-12-03 21:22:31
缺少的符号在CoreFoundation框架中-您需要添加:
-framework CoreFoundation添加到您的命令行。
https://stackoverflow.com/questions/13683581
复制相似问题