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" のパス「Linker->Input->Additional Dependencies」の「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;
}
私は道に迷っています。何が間違っていますか?