これは本当に理解できないものです。実際にこのエラーを起こしやすいものは何もありません。参照のためにいくつかの他のクラスと一緒にコンパイルエラー:期待値 ')' before '&'トークン
namespace Engine_Main {
class SceneManager
{
public:
SceneManager(Engine& engine);
void createScene();
private:
Ogre::SceneManager * mSceneMgr;
};
}
:
#ifndef ENGINE_H
#define ENGINE_H
#include <OGRE/OgreSceneManager.h>
#include <OGRE/OgreRoot.h>
#include "scenemanager.h"
#include "playerinput.h"
namespace Engine_Main {
class Engine
{
public:
Engine();
~Engine();
void initGameLoop();
PlayerInput * getPlayerInput();
PlayerMovement * getPlayerMovement();
Ogre::Root * getOgreRoot();
private:
//fields
PlayerInput * mPInput;
PlayerMovement * mPMovement;
Ogre::Root * mRoot;
//methods
void registerInput();
void createScene();
void renderPosition();
};
}
#endif // ENGINE_H
#include "engine.h"
namespace Engine_Main {
/**********/
/* PUBLIC */
/**********/
PlayerMovement * Engine::getPlayerMovement() {
return mPMovement;
}
PlayerInput * Engine::getPlayerInput() {
return mPInput;
}
Engine::Engine() {
mPInput = new PlayerInput();
mPMovement = new PlayerMovement();
mRoot = new Ogre::Root("cfg/plugins.cfg", "cfg/engine.cfg", "cfg/engine.log");
}
Engine::~Engine(){
if (mPInput) {
delete mPInput;
}
if (mRoot) {
delete mRoot;
}
}
void Engine::createScene() {
}
}
私の質問
それは私が間違ってやっていることは何ですか。ここ
は、クラスですか?
あなたの質問がありますか? –
エラーと行番号を転記できますか?それは簡単だろう。 – cppcoder
この情報には答えがありません。あなたは本当に私たちにエラーの文脈を伝えていません。どのファイルと行番号ですか?そのファイルのテキストは何ですか? – bobbymcr