在mac 10.6 snow leopard上编译时,libsndfile与libvorbis和libogg的链接错误

在mac 10.6 snow leopard上编译时,libsndfile与libvorbis和libogg的链接错误,libsndfile,Libsndfile,大家好,我正在Mac OSX 10.6上编译libsndfile 1.0.25 我已经用brew安装了libvorbis-1.3.4和libogg-1.3.1 1-我尝试用brew安装libsndfile 2-我尝试使用./configure和make手动安装libsndfile ./configure步骤似乎确实找到了libvorbis和libogg,我已经确认它们是 x86_64库。我希望输出中有一个我不理解的提示 实施,有人能很快发现。谢谢你的关注 BREW错误输出: ==> Dow

大家好,我正在Mac OSX 10.6上编译libsndfile 1.0.25

我已经用brew安装了libvorbis-1.3.4和libogg-1.3.1

1-我尝试用brew安装libsndfile

2-我尝试使用./configure和make手动安装libsndfile

./configure步骤似乎确实找到了libvorbis和libogg,我已经确认它们是 x86_64库。我希望输出中有一个我不理解的提示 实施,有人能很快发现。谢谢你的关注

BREW错误输出:

==> Downloading http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
Already downloaded: /Library/Caches/Homebrew/libsndfile-1.0.25.tar.gz
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
patching file programs/sndfile-play.c
patching file M4/clang.m4
patching file M4/really_gcc.m4
patching file configure.ac
==> autoreconf -i

If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:207: error: possibly undefined macro: AC_SYS_EXTRA_LARGEFILE
configure.ac:295: error: possibly undefined macro: AC_OCTAVE_BUILD
autoreconf: /usr/bin/autoconf failed with exit status: 1
  CCLD   libsndfile.la
Undefined symbols for architecture x86_64:
  "_vorbis_comment_clear", referenced from:
      _vorbis_end in ogg_vorbis.o
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_info_clear", referenced from:
      _vorbis_end in ogg_vorbis.o
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_stream_reset", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_reset", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_buffer", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_wrote", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_pageout", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_clear", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_close in libcommon.a(ogg.o)
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_page_serialno", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_pagein", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_packetout", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_vorbis_block_clear", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_dsp_clear", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_info_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_comment_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_synthesis_headerin", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
  "_vorbis_synthesis_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
  "_vorbis_block_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_comment_query", referenced from:
      _vorbis_read_header in ogg_vorbis.o
  "_vorbis_version_string", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
  "_ogg_sync_init", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_page_eos", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_sync_clear", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_close in libcommon.a(ogg.o)
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_page_granulepos", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
  "_vorbis_synthesis_pcmout", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_synthesis_read", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_synthesis", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_synthesis_blockin", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_analysis_wrote", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_analysis_blockout", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_analysis", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_bitrate_addblock", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_bitrate_flushpacket", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_stream_packetin", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_stream_pageout", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_analysis_buffer", referenced from:
      _vorbis_write_d in ogg_vorbis.o
      _vorbis_write_f in ogg_vorbis.o
      _vorbis_write_i in ogg_vorbis.o
      _vorbis_write_s in ogg_vorbis.o
  "_vorbis_comment_add_tag", referenced from:
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_analysis_init", referenced from:
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_analysis_headerout", referenced from:
      _vorbis_write_header in ogg_vorbis.o
  "_ogg_stream_flush", referenced from:
      _vorbis_write_header in ogg_vorbis.o
ld: symbol(s) not found for architecture x86_64
手动生成错误输出:

==> Downloading http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
Already downloaded: /Library/Caches/Homebrew/libsndfile-1.0.25.tar.gz
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
patching file programs/sndfile-play.c
patching file M4/clang.m4
patching file M4/really_gcc.m4
patching file configure.ac
==> autoreconf -i

If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:207: error: possibly undefined macro: AC_SYS_EXTRA_LARGEFILE
configure.ac:295: error: possibly undefined macro: AC_OCTAVE_BUILD
autoreconf: /usr/bin/autoconf failed with exit status: 1
  CCLD   libsndfile.la
Undefined symbols for architecture x86_64:
  "_vorbis_comment_clear", referenced from:
      _vorbis_end in ogg_vorbis.o
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_info_clear", referenced from:
      _vorbis_end in ogg_vorbis.o
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_stream_reset", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_reset", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_buffer", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_wrote", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_sync_pageout", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_clear", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_close in libcommon.a(ogg.o)
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_page_serialno", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_pagein", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_stream_packetout", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_vorbis_block_clear", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_dsp_clear", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_info_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_comment_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_synthesis_headerin", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _ogg_vorbis_open in ogg_vorbis.o
  "_vorbis_synthesis_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
  "_vorbis_block_init", referenced from:
      _vorbis_read_header in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_comment_query", referenced from:
      _vorbis_read_header in ogg_vorbis.o
  "_vorbis_version_string", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
  "_ogg_sync_init", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_page_eos", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
      _vorbis_read_sample in ogg_vorbis.o
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_sync_clear", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
      _ogg_close in libcommon.a(ogg.o)
      _ogg_open in libcommon.a(ogg.o)
  "_ogg_page_granulepos", referenced from:
      _ogg_vorbis_open in ogg_vorbis.o
  "_vorbis_synthesis_pcmout", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_synthesis_read", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_synthesis", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_synthesis_blockin", referenced from:
      _vorbis_read_sample in ogg_vorbis.o
  "_vorbis_analysis_wrote", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_analysis_blockout", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_analysis", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_bitrate_addblock", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_bitrate_flushpacket", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_stream_packetin", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_write_header in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_ogg_stream_pageout", referenced from:
      _vorbis_write_samples in ogg_vorbis.o
      _vorbis_close in ogg_vorbis.o
  "_vorbis_analysis_buffer", referenced from:
      _vorbis_write_d in ogg_vorbis.o
      _vorbis_write_f in ogg_vorbis.o
      _vorbis_write_i in ogg_vorbis.o
      _vorbis_write_s in ogg_vorbis.o
  "_vorbis_comment_add_tag", referenced from:
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_analysis_init", referenced from:
      _vorbis_write_header in ogg_vorbis.o
  "_vorbis_analysis_headerout", referenced from:
      _vorbis_write_header in ogg_vorbis.o
  "_ogg_stream_flush", referenced from:
      _vorbis_write_header in ogg_vorbis.o
ld: symbol(s) not found for architecture x86_64
一个解决方案: 我遇到了类似但不完全相同的libsndfile链接器错误

问题似乎存在于libsndfile tar.gz本身提供的
配置
脚本中

这是个好消息。这意味着libvorbis二进制和libogg二进制都没有问题。不存在阻止libsndfile与自制的libvorbis和libogg链接的基本ABI问题

我在libsndfile的
configure
脚本中找到了这些行:

EXTERNAL\u CFLAGS=“$FLAC\u CFLAGS$OGG\u CFLAGS$VORBISENC\u CFLAGS”
外部自由库=“$FLAC自由库$VORBISENC自由库”
(这些行是逐字复制的。缩进在原始脚本中是不可靠的。)

你注意到不一致吗

EXTERNAL\u CFLAGS
是通过连接3组标志形成的,但是
EXTERNAL\u LIBS
是通过仅连接2组标志形成的

如下更新这些行可以让我构建和链接所有内容:

EXTERNAL\u CFLAGS=“$FLAC\u CFLAGS$OGG\u CFLAGS$VORBIS\u CFLAGS$vorbisence\u CFLAGS”
外部自由库=“$FLAC自由库$OGG自由库$VORBIS自由库$VORBISENC自由库”
这就是解决问题所需要的全部


我的背景故事: 在最初的帖子(作者@ubob)中,尝试2被描述为:“使用./configure和make手动安装libsndfile”

在不知道传递给
/configure
的选项(如果有)的情况下,我无法确定我的答案是否适用于@ubob的场景

我的操作系统:Mac OS X 10.8.1

libsndfile源分发版本:libsndfile-1.0.24 (但我也尝试了libsndfile-1.0.25,发现与
外部库
的情况相同)

从自制中获得的依赖项:

flac/1.3.1/lib/libFLAC.8.dylib
libogg/1.3.2/lib/libogg.0.dylib
libvorbis/1.3.5/lib/libvorbis.0.dylib
libvorbis/1.3.5/lib/libvorbisenc.2.dylib
libvorbis/1.3.5/lib/libvorbisfile.3.dylib

我的生成命令:

导出CC=“铿锵-v” export FLAC_CFLAGS=“-I/whicher/path/leads/to/FLAC/1.3.1/include” export flaclibs=“-L/whicher/path/leads/toflac/1.3.1/lib-lFLAC.8” export OGG_CFLAGS=“-I/whicher/path/leads/tolibogg/1.3.2/include” export OGG_LIBS=“-L/whicher/path/leads/tolibogg/1.3.2/lib-logg.0” export VORBIS_CFLAGS=“-I/whicher/path/leads/tolibvorbis/1.3.5/include” export VORBIS_LIBS=“-L/whicher/path/leads/tolibvorbis/1.3.5/lib-lvorbis.0” export VORBISENC_CFLAGS=“-I/whicher/path/leads/tolibvorbis/1.3.5/include” export VORBISENC_LIBS=“-L/whicher/path/leads/tolibvorbis/1.3.5/lib-lvorbisenc.2-lvorbisfile.3” ./configure--enable external libs--disable static--enable shared--disable sqlite--disable dependency tracking 制作
一旦我对上述
EXTERNAL\u CFLAGS
EXTERNAL\u LIBS
进行了调整,我就能够成功地构建一个合适的
libsndfile.1.dylib
,它现在在我的应用程序中得到了很好的使用,并且运行良好


作为参考,我的链接器错误如下:

CCLD libsndfile.la Undefined symbols for architecture x86_64: "_ogg_page_eos", referenced from: _ogg_open in ogg.o _ogg_close in ogg.o _ogg_read_sample in ogg.o _ogg_write_samples in ogg.o "_ogg_page_granulepos", referenced from: _ogg_open in ogg.o "_ogg_page_serialno", referenced from: _ogg_open in ogg.o _ogg_read_header in ogg.o [OMITTED FOR BREVITY] "_ogg_stream_reset", referenced from: _ogg_read_header in ogg.o "_ogg_sync_buffer", referenced from: _ogg_open in ogg.o _ogg_read_header in ogg.o _ogg_read_sample in ogg.o "_ogg_sync_clear", referenced from: _ogg_open in ogg.o _ogg_close in ogg.o "_ogg_sync_init", referenced from: _ogg_open in ogg.o "_ogg_sync_pageout", referenced from: _ogg_open in ogg.o _ogg_read_header in ogg.o _ogg_read_sample in ogg.o "_ogg_sync_reset", referenced from: _ogg_read_header in ogg.o [OMITTED FOR BREVITY] "_vorbis_comment_clear", referenced from: _ogg_open in ogg.o _ogg_read_header in ogg.o _ogg_close in ogg.o "_vorbis_comment_init", referenced from: _ogg_open in ogg.o _ogg_read_header in ogg.o _ogg_write_header in ogg.o "_vorbis_comment_query", referenced from: _ogg_read_header in ogg.o "_vorbis_dsp_clear", referenced from: _ogg_read_header in ogg.o _ogg_close in ogg.o "_vorbis_info_clear", referenced from: _ogg_open in ogg.o _ogg_read_header in ogg.o _ogg_close in ogg.o [OMITTED FOR BREVITY] ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) CCLD libsndfile.la 架构x86_64的未定义符号: “_ogg_page_eos”,引用自: _ogg_在ogg.o中打开 _ogg_在ogg.o中关闭 _ogg_读取ogg.o中的样本 _ogg_在ogg.o中写入样本 “\u ogg\u page\u granulepos”,引用自: _ogg_在ogg.o中打开 “\u ogg\u page\u serialno”,引用自: _ogg_在ogg.o中打开 _ogg.o中的ogg_read_头 [为简洁起见省略] “_ogg_stream_reset”,引用自: _ogg.o中的ogg_read_头 “_ogg_sync_buffer”,引用自: _ogg_在ogg.o中打开 _ogg.o中的ogg_read_头 _ogg_读取ogg.o中的样本 “\u ogg\u sync\u clear”,引用自: _ogg_在ogg.o中打开 _ogg_在ogg.o中关闭 “\u ogg\u sync\u init”,引用自: _ogg_在ogg.o中打开 “\u ogg\u sync\u pageout”,引用自: _ogg_在ogg.o中打开 _ogg.o中的ogg_read_头 _ogg_读取ogg.o中的样本 “\u ogg\u sync\u reset”,引用自: _ogg.o中的ogg_read_头 [为简洁起见省略] “_vorbis_comment_clear”,引用自: _ogg_在ogg.o中打开 _ogg.o中的ogg_read_头 _ogg_在ogg.o中关闭 “_vorbis_comment_init”,引用自: _ogg_在ogg.o中打开 _ogg.o中的ogg_read_头 _ogg.o中的ogg_write_头 “\u vorbis\u comment\u query”,引用自: _ogg.o中的ogg_read_头 “_vorbis_dsp_clear”,参考自: _ogg.o中的ogg_read_头 _ogg_在ogg.o中关闭 “\u vorbis\u info\u clear”,引用自: _ogg_在ogg.o中打开 _ogg.o中的ogg_read_头 _ogg_在ogg.o中关闭 [为简洁起见省略] ld:找不到架构x86_64的符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用)
已找到进一步的支持证据。在我记录了上述解决方案之后,我发现Axel Roebel以类似的方式修补了MacPorts libsndfile: