开发者

Ogg/Vorbis: _ov_fopen cannot be found

开发者 https://www.devze.com 2022-12-27 02:37 出处:网络
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_

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 O开发者_JAVA百科gg/Vorbis file to be used with OpenAL on Windows?

Thanks in advance.


Are you linking with libogg, libvorbis and libvorbisfile?


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.

#include <vorbis/vorbisfile.h>

Make sure your linker knows where to find the lib file.

Note that you'll need to either compile with -Wunused-variable or;

#define OV_EXCLUDE_STATIC_CALLBACKS

...before the include.

0

精彩评论

暂无评论...
验证码 换一张
取 消