使用 Visual Studio 10,我未能编译提供的示例代码openal
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
我已经安装了 OpenAL11CoreSDK,正在执行oalinst.exe
,还下载freealut-1.1.0-bin
了我已经将“OpenAL 1.1 SDK\ include”中的所有文件复制到“Microsoft Visual Studio 10.0\VC\include\AL”,我也在alut.h
里面freealut-1.1.0-bin
放了 alut.lib 和 OpenAL32.lib在“Microsoft Visual Studio 10.0\VC\libs”中,我将 alut.dll 和 OpenAL32.dll 放在“C:\Windows\SysWOW64”和“C:\Windows\System32”
中,我已经包含了“Microsoft Visual Studio 10.0\ “项目->属性->VC++目录->包含目录”和“C/C++->常规->附加包含目录”中的“VC\include\AL”
“库目录”和“链接器->中的“VC\lib” General->Additional Library Directories” “alut.lib”的路径和“链接器->输入->附加依赖项”中的“OpenAL.lib”
我想我已经链接了所有库,但我仍然收到链接器错误:
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;
}
我迷路了,我做错了什么?