I'm getting problems with this code. I'm trying to use OpenAL. A sound SDK developed by the makers of OpenGL. When I use this code:
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <al/al.h>
#include <al/alc.h>
#include <al/alu.h>
#include <al/alut.h>
ALuint Buffer;
ALuint Source;
float SourcePos[]={0.0f,0.0f,0.0f};
float SourceVel[]={0.0f,0.0f,0.0f};
float ListenerPos[]={0.0f,0.0f,0.0f};
float ListenerVel[]={0.0,0.0,0.0};
float ListenerOri[]={0.0f,0.0f,0.0f,0.0f,0.0f,0.0f};
ALboolean LoadALData()
{
ALenum format;
ALsizei size;
ALvoid* data;
ALsizei freq;
ALboolean loop;
alGenBuffers(1, &Buffer);
if(alGetError() != AL_NO_ERROR)
return AL_FALSE;
alutLoadWAVFile("sound.wav", &format, &data, &size, &freq, &loop);
alBufferData(Buffer, format, data, size, freq);
alUnloadWav(format, data, size, freq);
alGenSources(1, &Source);
if(alGetError() != AL_NO_ERROR)
return AL_TRUE;
return AL_FALSE;
}
void SetListenerValues()
{
alListenerfv(AL_POSITION, ListenerPos);
alListenerfv(AL_VELOCITY, ListenerVel);
alListenerfv(AL_ORIENTATION, ListenerOri);
}
int main(int argc, char *argv[])
{
alutInit(NULL, 0);
alGetError();
if(LoadALData() == AL_FALSE)
{
printf("Error loading data...");
return 0;
}
SetListenerValues();
atexit(KillALData);
return 0;
}
I get these errors: Error 1 error C3861: 'alutLoadWAVFile': identifier not found 30
Error 2 error C3861: 'alUnloadWav': identifier not found 32
Error 3 error C2065: 'KillALData' : undeclared identifier 61