これは何度も尋ねられたことは知っていますが、これを解決する答えはありません。C++警備員を含む
私は2つのファイルを持っています。
MAIN.CPP
#include <irrlicht\irrlicht.h>
#include <vector>
#include <string>
#include <iostream>
#include "Scene.h"
#include "Camera.h"
#include "Gui.h"
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
int main() {
device = irr::createDevice(irr::video::EDT_SOFTWARE, irr::core::dimension2d<irr::u32>(640, 480), 16, false, false, false, 0);
if (!device)
return 1;
device->setWindowCaption(L"NeoTrap");
driver = device->getVideoDriver();
sceneManager = device->getSceneManager();
GUIEnvironment = device->getGUIEnvironment();
//Testing
Mesh* ground = new Mesh();
//Testing
while (device->run()) {
driver->beginScene(true, true, irr::video::SColor(255, 120, 102, 136));
sceneManager->drawAll();
GUIEnvironment->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
Scene.h
#ifndef _SCENE_HEADER_
#define _SCENE_HEADER_
irr::scene::ISceneManager* sceneManager;
struct Mesh {
public:
Mesh();
private:
};
class Scene {
public:
Scene();
private:
};
#endif
私はScene.hで変数を宣言されて行うと、main関数内からそれを定義しようとしています。私は警備員を含めて理解できないのか分かりませんが、奇妙なエラーが発生しています:
'irr':クラスまたは名前空間の名前ではありません 構文エラー: before '*' 型指定子がない - 想定されています。注:C++は、デフォルト-INT
サポートしていませんが、私はMAIN.CPPに戻って次の行を移動したときに
irr::scene::ISceneManager* sceneManager;
プログラムのコンパイルファイル。私がscene.hで宣言できず、main関数から値を設定できないのでしょうか?
'IRR ::シーン:: ISceneManager'が定義されているファイルでは? – tmpearce
Scene.h、一番上にあります。 – Kurieita
いいえ、そういう意味でポインタ型の変数を宣言しています。 ** type **(クラスまたは構造体)はどこに定義されていますか? – tmpearce