c++ - 未找到 libFLAC 符号和 vtable 错误

标签 c++ c audio flac

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

现在,将 FLAC header 和库的路径添加到一个全新的项目中之后。我正在尝试使用 libFLAC 解码 FLAC 音频并将其加载到系统内存中,在与 libFLAC 捆绑在一起的示例代码下。但是,我在使用标准 C 时遇到 symbol not find 错误,在使用标准 C++ 方法时遇到 vtable symbol not find 错误(如下所示)。

C 方法下的错误:

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 退出状态

据我所知:链接器没有看到库(因为它看到了 header )或 libFLAC 未正确编译。如果有人指出我针对这些错误可能的解决方案,我将不胜感激。

最佳答案

我错误地进行了链接。链接需要根据此 stackoverflow 帖子 Adding static library inside Xcode C++ project ( How to add static libraries inside a C++ project with Xcode ) 完成,但我在我所在的 Project Settings 下添加了链接目录添加我的标题路径,因此它不起作用。

关于c++ - 未找到 libFLAC 符号和 vtable 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20263199/

相关文章:

c++ - boost::optional deprecated get_value_or

c - 帮助 Trie 实现

c - pipe()、fork() 和 sleep()

video - 您如何安全地识别 mp4 是纯音频文件还是视频文件

C++ 隐式复制构造函数和赋值运算符

Eclipse for Android NDK 中的 C++ static const 多重声明错误

c++ - std::find_end 作为 Big-O 的复杂性

javascript - 为什么这段 C 代码在 JavaScript 中不起作用?

java - 声音捕捉。 MacOS 权限。 Java 音频 API

c - 使用 ALSA API 演奏视唱音符?