【问题标题】:libFLAC symbols not found and vtable errors未找到 libFLAC 符号和 vtable 错误
【发布时间】:2013-11-28 10:13:18
【问题描述】:

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

现在将 FLAC 头文件和库的路径添加到一个全新的项目中。在与 libFLAC 捆绑的示例代码下,我正在尝试使用 libFLAC 解码 FLAC 音频并将其加载到系统内存中。但是,我在标准 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*, 

FLAC__StreamDecoderErrorStatus, void*)in main.o

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

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

【问题讨论】:

标签: c++ c audio flac


【解决方案1】:

我的链接不正确。链接需要根据这个stackoverflow帖子Adding static library inside Xcode C++ projectHow to add static libraries inside a C++ project with Xcode)完成,但我在Project Setting下添加了链接目录,我在其中添加了我的标题路径,因此它不起作用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-20
    • 1970-01-01
    • 1970-01-01
    • 2012-05-08
    • 2018-07-31
    • 2011-12-08
    相关资源
    最近更新 更多