【发布时间】: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 未正确编译。鉴于这些错误,如果有人能指出可能的解决方案,我将不胜感激。
【问题讨论】:
-
什么 exact 命令导致了这个错误?
-
@rubenvb 这些错误是在C下编译这个示例代码github.com/oneman/libflac/blob/master/examples/c/decode/file/…和C++下这个github.com/oneman/libflac/blob/master/examples/cpp/decode/file/…