Using Visual Studio 10, I have failed to compile the example codes provided by openal
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
I've installed OpenAL11CoreSDK, executing oalinst.exe
, also download freealut-1.1.0-bin
I've copied all files inside of "OpenAL 1.1 SDK\ include" to "Microsoft Visual Studio 10.0\VC\include\AL", also alut.h
inside freealut-1.1.0-bin
I put alut.lib and OpenAL32.lib in "Microsoft Visual Studio 10.0\VC\libs"
I put alut.dll and OpenAL32.dll in "C:\Windows\SysWOW64" and "C:\Windows\System32"
I have included the path of "Microsoft Visual Studio 10.0\VC\include\AL" in "Project->Properties->VC++ Directories->Include Directories" and "C/C++ ->General->Additional Include Directories"
"VC\lib" in "Library Directories" and "Linker->General->Additional Library Directories"
the path of "alut.lib" and "OpenAL.lib" in "Linker->Input->Additional Dependencies"
I think I've linked all libraries, but I still get linker errors:
1>test.obj : error LNK2019: unresolved external symbol __imp__alSourcePlay referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__alSourcei referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__alGenSources referenced in function _main<br>
1>C:\Users\SONY\Documents\Visual Studio 2010\Projects\test\Debug\test.exe : fatal error LNK1120: 3 unresolved externals
#include <stdlib.h>
#include <AL/alut.h>
/*
This is the 'Hello World' program from the ALUT
reference manual.
Link using '-lalut -lopenal -lpthread'.
*/
int
main (int argc, char **argv)
{
ALuint helloBuffer, helloSource;
alutInit (&argc, argv);
helloBuffer = alutCreateBufferHelloWorld ();
alGenSources (1, &helloSource);
alSourcei (helloSource, AL_BUFFER, helloBuffer);
alSourcePlay (helloSource);
alutSleep (1);
alutExit ();
return EXIT_SUCCESS;
}
I'm lost, what am I doing wrong?