PDA

View Full Version : Need help on OpenAL



Ehsan Nekooee
08-19-2009, 04:42 AM
HI people

I know I should not ask this here but I couldn't find appropriate place to ask it.

I am trying to use OpenAL in a super simple hello world sample thing for the first time and but I get an error for almost each line !

I included many OpenAL headers, copied these files almost everywhere in my Hard Disk:
openal32.dll
alut.dll
alut.lib

but still no action!

here is the code:


#include <stdlib.h>
#include <AL\alut.h>
#include <AL\alc.h>
#include <AL\al.h>

int main (int argc, char *argv[])
{
ALuint helloBuffer, helloSource;
alutInit (&amp;argc, argv);
helloBuffer = alutCreateBufferHelloWorld ();
alGenSources (1, &amp;helloSource);
alSourcei (helloSource, AL_BUFFER, helloBuffer);
alSourcePlay (helloSource);
alutSleep (1);
alutExit ();
return EXIT_SUCCESS;
}


And I get these errors :


1>------ Build started: Project: AL, Configuration: Debug Win32 ------
1>Compiling...
1>hello_world.c
1>Linking...
1>hello_world.obj : error LNK2019: unresolved external symbol __imp__alutExit referenced in function _main
1>hello_world.obj : error LNK2019: unresolved external symbol __imp__alutSleep referenced in function _main
1>hello_world.obj : error LNK2019: unresolved external symbol _alSourcePlay referenced in function _main
1>hello_world.obj : error LNK2019: unresolved external symbol _alSourcei referenced in function _main
1>hello_world.obj : error LNK2019: unresolved external symbol _alGenSources referenced in function _main
1>hello_world.obj : error LNK2019: unresolved external symbol __imp__alutCreateBufferHelloWorld referenced in function _main
1>hello_world.obj : error LNK2019: unresolved external symbol __imp__alutInit referenced in function _main
1>C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\AL\Debug\AL.exe : fatal error LNK1120: 7 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\AL\AL\Debug\BuildLog.htm"
1>AL - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


P.S: I use microsoft visual c++ express edition 2008

ZbuffeR
08-19-2009, 05:23 AM
do you define alut.lib to be used on the linking phase ?

Ehsan Nekooee
08-19-2009, 05:28 AM
tahnx ZbuffeR for your concern.

Well ... I don't think I have done that so far :D
How can I do that thing you said?

ZbuffeR
08-19-2009, 09:51 AM
No idea, I do not use it. Click here ! (http://www.google.com/search?q=how+to+add+lib+linker+visual+c%2B%2B)

Ehsan Nekooee
08-19-2009, 10:00 AM
thanx mate
I figured it out