我正在编译一个使用 SDL_mixer 播放.ogg
文件的项目。但是,Mix_Init(MIX_INIT_OGG)
失败并Mix_GetError()
返回"Mixer not built with Ogg Vorbis support"
。我使用的 SDL_mixer 版本是 1.2.12,通过 Homebrew 下载。
所以我下载了 SDL_mixer 的源代码(相同版本,1.2.12),并尝试使用 Ogg 支持构建它,即./configure --enable-music-ogg
,但configure
无法找到 Vorbis 头文件。这是它给出的输出:
checking vorbis/vorbisfile.h usability... no
checking vorbis/vorbisfile.h presence... no
checking for vorbis/vorbisfile.h... no
checking for ov_open_callbacks in -lvorbisfile... no
configure: WARNING: *** Unable to find Ogg Vorbis library (http://www.xiph.org/)
configure: WARNING: Ogg Vorbis support disabled
我什至尝试传递--includedir=/usr/local/include
给configure
,但没有成功。我有 Vorbis 和 Ogg 头文件/usr/local/include
,所以例如路径vorbisfile.h
是/usr/local/include/vorbis/vorbisfile.h
. 我还尝试从头开始构建 libogg 和 libvorbis,但我仍然遇到相同的错误。我正在使用 OS X 10.11.1 测试版。
我究竟做错了什么?
编辑
输出brew ls sdl_mixer
:
/usr/local/Cellar/sdl_mixer/1.2.12/include/SDL/SDL_mixer.h
/usr/local/Cellar/sdl_mixer/1.2.12/lib/libSDL_mixer-1.2.0.dylib
/usr/local/Cellar/sdl_mixer/1.2.12/lib/pkgconfig/SDL_mixer.pc
/usr/local/Cellar/sdl_mixer/1.2.12/lib/ (2 other files)