views:

62

answers:

2

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.

+1  A: 

Are you linking with libogg, libvorbis and libvorbisfile?

SurvivalMachine
A: 

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.

RJFalconer