我正在整合我當前的遊戲引擎與irrKlang聲音引擎,並且正在處理持續性錯誤。簡化:爲什麼此代碼會生成編譯器錯誤C2227?
fsCore.h
class fsEngine
{
public:
static fsEngine *getInstance();
static void release();
;
private:
static fsEngine *instance;
static fsBool exists;
irrklang::ISoundEngine *soundEngine;
};
fsCore.cpp
#include "fsCore.h"
void fsEngine::release()
{
exists = false;
delete instance;
soundEngine->drop(); //C2227
};
發動機被正確申報,並如期單正在執行。有任何想法嗎?
如果'釋放()'是靜態的,怎麼能訪問'soundEngine',這是一個*實例*會員? – 2013-05-02 17:37:24
[Here](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)。 – 2013-05-02 17:41:30