【发布时间】:2019-03-29 00:02:26
【问题描述】:
我正在尝试按照Initialising PortAudio tutorial 中的说明初始化 portaudio。
它说要检查初始化过程中是否有错误,如下所示:
PaError err = Pa_Initialize();
if (err != paNoError) goto error;
这是我使用的确切代码。
我在 OS X Mojave 10.14.4 上运行它,使用 Xcode 10.1 和 10.12 OS X SDK。
我试图在 PortAudio 文档中查找错误标签的位置无济于事,并且名为 error 的文件中没有变量。
到目前为止的完整程序是:
# include <iostream>
# include "portaudio.h"
using namespace std;
// Typedef and demo callbacks here.
int main(int argc, const char * argv[])
{
PaError err = Pa_Initialize();
if (err != paNoError) goto error;
// Nothing here yet.
err = Pa_Terminate();
if (err != paNoError)
{
printf("Port audio error terminating: %s", Pa_GetErrorText(err));
}
return 0;
}
据我在教程中可以看出,这应该是一个有效的语句,但 Xcode 显示语法错误:
Use of undeclared label 'error'
【问题讨论】: