C++ 未找到Fmod constans(Fmod_硬件)
我在Ubuntu中使用FMOD在游戏中播放声音 我有下一个C++ 未找到Fmod constans(Fmod_硬件),c++,ubuntu,fmod,C++,Ubuntu,Fmod,我在Ubuntu中使用FMOD在游戏中播放声音 我有下一个 #include "SoundEngine.h" bool SoundEngine::initSystem() { System_Create(&system);// create an instance of the game engine system->init(32, FMOD_INIT_NORMAL, 0);// initialise the game engine with 32 channels //
#include "SoundEngine.h"
bool SoundEngine::initSystem()
{
System_Create(&system);// create an instance of the game engine
system->init(32, FMOD_INIT_NORMAL, 0);// initialise the game engine with 32 channels
//load sounds
system->createSound("Media/NoMoreMagic.ogg", FMOD_HARDWARE, 0, &sound1);
sound1->setMode(FMOD_LOOP_OFF); /* drumloop.wav has embedded loop points which automatically makes looping turn on, */
/* so turn it off here. We could have also just put FMOD_LOOP_OFF in the above CreateSound call. */
system->playSound(FMOD_CHANNEL_FREE, sound1, false, 0);
return true;
}
而SoundEngine.h是:
#ifndef SOUNDENGINE_H_
#define SOUNDENGINE_H_
#include "FMOD/inc/fmod.hpp" //fmod c++ header
#pragma comment( lib, "fmodex_vc.lib" ) // fmod library
using namespace FMOD;
class SoundEngine{
public:
bool initSystem(void);
private:
//FMod Stuff
System *system; //handle to FMOD engine
Sound *sound1, *sound2; //sound that will be loaded and played
};
#endif /* SOUNDENGINE_H_ */
问题是找不到FMOD_硬件或FMOD_通道空闲
有人知道他们在哪里吗
编辑:另一件事是pragma注释抛出一个警告,告诉我们忽略pragma。也许这个问题与布拉格语有关?如何修复pragma?我相信FMOD\u硬件来自较旧的FMOD exapi。你在使用FMOD 5吗?在调用System::createSound时,我使用了FMOD_DEFAULT或FMOD_CREATESAMPLE(后者将加载整个声音并将其解压缩到内存中,以加速播放),这似乎很好地使用了硬件。您的playSound通话,请尝试
FMOD::Channel *channel;
system->playSound(sound1, NULL, false, &channel);
<代码> > PracMyActudio</C>链接库是微软Visual C++扩展。另外,您正在尝试链接POSIX系统(如Ubuntu)上的
.lib
文件,该文件通常是Windows库。静态库文件以.a
结尾。我使用的是Eclipse,所以我只需要转到“首选项”并将其放入菜单路径和符号中的库中,对吗?