未找到libFLAC符号和vtable错误

我已经从macintosh os x 10.6.8下的源代码编译了libFLAC,并成功测试了WAV到FLAC的转换(从命令行)。 我也使用了默认构建:./ configure –prefix =“$ base / flac / more /” – exec-prefix =“$ base / flac / main /” – disable-asm-optimizations && make && make install

现在将FLAC头文件和库的路径添加到一个全新的项目中之后。 我试图使用libFLAC解码并将FLAC音频加载到系统内存中,在libFLAC捆绑的示例代码下。 但是,我使用标准C +方法得到symbols not found错误标准C和vtable symbols not found错误(如下所示)。

Errors under the C approach:

FLAC _stream_decoder_get_state”,引自:

  _main in main.o 

FLAC _stream_decoder_new”,引自:

  _main in main.o 

FLAC _StreamDecoderStateString”,引自:

  _main in main.o 

FLAC _StreamDecoderErrorStatusString”,引自:

  error_callback(FLAC__StreamDecoder const*, 

main.o中的FLAC__StreamDecoderErrorStatus,void *)

FLAC _stream_decoder_init_file”,引自:

  _main in main.o 

FLAC _StreamDecoderInitStatusString”,引自:

  _main in main.o 

FLAC _stream_decoder_set_md5_checking”,引自:

  _main in main.o 

FLAC _stream_decoder_process_until_end_of_stream”,引自:

  _main in main.o 

FLAC _stream_decoder_delete”,引自:

  _main in main.o 

ld:找不到符号

collect2:ld返回1退出状态

从我可以理解的是:链接器没有看到libs(因为它看到了标题)或者libFLAC没有正确编译。 如果有人会在给出这些错误的情况下指出可能的解决方案,我将感激不尽。

我做错了链接。 链接需要根据此stackoverflow post Adding static library inside Xcode C++ project 中添加静态库 ( 如何使用 Adding static library inside Xcode C++ project 中添加静态库 )但我在Project Setting下添加了链接目录,我添加了我的头路径,因此它不起作用。