使用Visual Studio 10,我未能通过openal
错误LNK2019同时使用ALUT
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
我已经安装了OpenAL11CoreSDK编译提供的示例代码,执行oalinst.exe
,还下载freealut-1.1.0-bin
我已经我将alut.lib和OpenAL32.lib放在“Microsoft Visual Studio 10.0 \ VC \ include \库“ 我把alut.dll和OpenAL32.dll放在“C:\ Windows \ SysWOW64”和“C:\ Windows \ System32”中
我已将“Microsoft Visual Studio 10.0 \ VC \ include \ AL”项目 - >属性 - > VC++目录 - >包含目录“和”C/C++ - >常规 - >其他包含目录“
”库目录“和”链接器 - >常规 - >其他库目录中的“VC \ lib” “ 的路径‘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;
}
我迷路了,我究竟做错了什么?
你说你的链接器输入使用OpenAL.lib运行编译可执行文件,但lib文件是alut.lib – thisisdog 2013-03-16 19:40:21
即使“OpenAL.lib”的路径已从链接器输入中删除,它也不起作用。 – millie 2013-03-17 04:32:39