Ogg/Vorbis:找不到 _ov_fopen
我正在尝试将 Ogg/Vorbis 与 OpenAL 结合使用来在我的游戏中获得声音。现在我只是尝试加载 .ogg 文件并读取其数据,实际上我并没有对它执行任何操作。我第一次尝试使用 ov_open
,但是,文档说我确实应该在 Windows 上使用 ov_fopen
。
然而,当我尝试使用它时,我得到以下结果:
1>AudioManager.obj : error LNK2019: unresolved external symbol _ov_fopen
referenced in function "private: static struct SomeGame::SoundData * __cdecl
SomeGame::AudioManager::LoadOGG(char *)"
(?LoadOGG@AudioManager@SomeGame@@CAPAUSoundData@2@PAD@Z)
...当我 Google“未解析的外部符号 _ov_fopen”时,我得到了一个结果。而且是日语的。
所以我尝试下载 ogg 和 vorbis 源代码并编译它,并将它们插入到项目中,但它仍然给我同样的错误。
基本上,如何加载 Ogg/Vorbis 文件以便在 Windows 上与 OpenAL 一起使用?
提前致谢。
I'm trying to use Ogg/Vorbis with OpenAL to get sound in my game. Right now I'm simply trying to load a .ogg file and read its data, I'm not actually doing anything with it. I first tried using ov_open
, however, the documentation said I should really be using ov_fopen
on Windows.
However, when I try to use that I get the following:
1>AudioManager.obj : error LNK2019: unresolved external symbol _ov_fopen
referenced in function "private: static struct SomeGame::SoundData * __cdecl
SomeGame::AudioManager::LoadOGG(char *)"
(?LoadOGG@AudioManager@SomeGame@@CAPAUSoundData@2@PAD@Z)
...and when I Google "unresolved external symbol _ov_fopen", I get exactly one result. And it's in Japanese.
So I tried downloading the ogg and vorbis source and compiling it, and inserting those in the project, but it still gives me the same error.
Basically, how do I load in an Ogg/Vorbis file to be used with OpenAL on Windows?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否正在链接 libogg、libvorbis 和 libvorbisfile?
Are you linking with libogg, libvorbis and libvorbisfile?
进一步SurvivalMachine的回答;
Dependency Walker 显示 _ov_fopen 明确定义在 libvorbisfile.dll 中
或者在 Linux 上,“nm libvorbisfile.a | grep _ov_fopen " 显示 _ov_fopen 已在那里定义。
确保您的链接器知道在哪里可以找到 lib 文件。
请注意,您需要使用
-Wunused-variable
进行编译,或者;...在包含之前。
Further to SurvivalMachine's answer;
Dependency Walker shows _ov_fopen is definitely defined in libvorbisfile.dll
Or on linux, "nm libvorbisfile.a | grep _ov_fopen" shows _ov_fopen is defined there.
Make sure your linker knows where to find the lib file.
Note that you'll need to either compile with
-Wunused-variable
or;...before the include.