2015-10-04 122 views
2

我編譯的項目使用SDL_mixer來播放.ogg文件。但是,Mix_Init(MIX_INIT_OGG)失敗,Mix_GetError()返回"Mixer not built with Ogg Vorbis support"。我使用的SDL_mixer版本是1.2.12,通過Homebrew下載。./configure找不到頭文件

所以,我下載了SDL_mixer源(相同的版本,1.2.12),並試圖與奧格支持構建它,即./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/includeconfigure,但沒有成功。我有/usr/local/include中的Vorbis和Ogg頭文件,例如到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) 
+1

不知道你用來安裝'SDL_mixer'什麼命令,讓我們說這是'brew install sdl_mixer',既然如此,你可以嘗試'brew options sdl_mixe r'來查看是否有*「ogg選項」*。 –

+0

@MarkSetchell我用'brew install sdl_mixer'完成了。我剛剛檢查過,有一個'--with-libvorbis'選項,但由於某種原因似乎沒有工作,SDL仍然說「Mixer不是用Ogg Vorbis支持構建的」。 – emlai

+0

因此,我認爲你現在已經完成了'brew install sdl_mixer --with-libvorbis'?如果你這樣做'brew ls sdl_mixer',它會告訴你它已經安裝了什麼以及在哪裏。 –

回答

1

您可以運行現在

brew install sdl2_mixer --with-libvorbis 
+0

這就是我跑的(除了'sdl_mixer',而不是'sdl2_mixer'),但它沒有幫助。 – emlai

+0

哦,對不起,這必須是獨家的sdl2_mixer公式 – afk