3

FMOD の使用を開始しようとしていますが、このチュートリアルのサンプル コードのコンパイルで問題が発生しています。

http://www.gamedev.net/reference/articles/article2098.asp

私は MinGW を使用しています。libfmodex.a ファイルを MinGW のインクルード フォルダーに配置しました (ファイル名に直接リンクしようとしました) が、機能しません。これが出力です。

C:\>g++ -o test1.exe test1.cpp -lfmodex
test1.cpp:4:1: error: 'FSOUND_SAMPLE' does not name a type
test1.cpp: In function 'int main()':
test1.cpp:9:29: error: 'FSOUND_Init' was not declared in this scope
test1.cpp:12:4: error: 'handle' was not declared in this scope
test1.cpp:12:53: error: 'FSOUND_Sample_Load' was not declared in this scope
test1.cpp:13:30: error: 'FSOUND_PlaySound' was not declared in this scope
test1.cpp:21:30: error: 'FSOUND_Sample_Free' was not declared in this scope
test1.cpp:22:17: error: 'FSOUND_Close' was not declared in this scope

これは私が使用している特定の例です:

#include <conio.h>
#include "inc/fmod.h"

FSOUND_SAMPLE* handle;

int main ()
{
   // init FMOD sound system
   FSOUND_Init (44100, 32, 0);

   // load and play sample
   handle=FSOUND_Sample_Load (0,"sample.mp3",0, 0, 0);
   FSOUND_PlaySound (0,handle);

   // wait until the users hits a key to end the app
   while (!_kbhit())
   {
   }

   // clean up
   FSOUND_Sample_Free (handle);
   FSOUND_Close();
}

コードがある「inc」パスにヘッダーファイルがあります。私が間違っていることについてのアイデアはありますか?

4

2 に答える 2

6

これは古いチュートリアルであり、FMODAPIはそれ以降変更されています。

たとえば、の代わりにFSOUND_SAMPLE、今ですFMOD::Sound(私は思います)。

内部をfmod.h見ると、使用する必要のあるクラスと関数がわかります。

于 2010-12-31T16:50:02.403 に答える
2

gamedev の記事は古く、古いバージョンのライブラリを使用しています。FMOD Programmers API のサンプル ディレクトリを参照してください。

于 2010-12-31T16:58:53.020 に答える