我正在尝试使用 Netbeans (g++) 编译一个程序,其中包括 Aquila,一个开源库 https://github.com/zsiciarz/aquila。我跟着安装说明 http://aquila-dsp.org/download/.
但是当尝试编译一个小测试程序时,我收到此错误
In function `Aquila::OouraFft::fft(double const*)':OouraFft.cpp:(.text+0x24f):
undefined reference to `cdft'
OouraFft.h:
#include "Fft.h"
extern "C" {
void cdft(int, int, double *, int *, double *); //prototypes of offending function
void rdft(int, int, double *, int *, double *); //second one.
}
libs 文件夹中的 C 文件包含函数的定义。
导致实际错误的行
OouraFft.cpp:
// let's call the C function from Ooura's package
cdft(2*N, -1, a, ip, w);
所以我认为外部 C 文件没有与项目链接,而是包含项目目录中的所有目录。
我已经用谷歌搜索了几个小时但无法弄清楚。