c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\DX9\Irrlicht\Game\RPG\RPG.h(38): error C2040: 'device' : 'irr::IrrlichtDevice *' differs in levels of indirection from ''unknown-type''
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\DX9\Irrlicht\Game\RPG\mnuMain.h(27): error C2065: 'device' : undeclared identifier
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\DX9\Irrlicht\Game\RPG\mnuMain.h(27): error C2227: left of '->getGUIEnvironment' must point to class/struct/union
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(17): error C3861: 'device': identifier not found, even with argument-dependent lookup
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(20): error C2227: left of '->setWindowCaption' must point to class/struct/union
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(20): error C3861: 'device': identifier not found, even with argument-dependent lookup
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(23): error C2228: left of '.getVideoDriver' must have class/struct/union type
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(23): error C3861: 'device': identifier not found, even with argument-dependent lookup
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(25): error C2227: left of '->getSceneManager' must point to class/struct/union
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(25): error C3861: 'device': identifier not found, even with argument-dependent lookup
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(27): error C2227: left of '->getGUIEnvironment' must point to class/struct/union
type is ''unknown-type''
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(27): error C3861: 'device': identifier not found, even with argument-dependent lookup
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(33): error C2227: left of '->run' must point to class/struct/union
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(33): error C3861: 'device': identifier not found, even with argument-dependent lookup
c:\Documents and Settings\Administrator.SERVER\My Documents\Visual Studio Projects\c++\DirectX\Dx9\Irrlicht\Game\Rpg\RPG.cpp(33): fatal error C1903: unable to recover from previous error(s); stopping compilation
And the following is all of my code.
rpg.cpp
Code: Select all
#include "RPG.h"
int main()
{
device = createDevice( video::EDT_DIRECT3D9, dimension2d<s32>(1024, 768), 32, true, true, true, 0 );
device->setWindowCaption(L"RPG DEBUG");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guiEnv = device->getGUIEnvironment();
guiEnv->addStaticText(L"Welcome to RPG!", rect<int>(10,10,10,10), true);
//Rendering loop is executed here
while ( device->run() )
{
/*
Everything gets drawn between the beginscene() and endscene()
*/
driver->beginScene(true, true, SColor(255,155,50,120) );
smgr->drawAll();
guiEnv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
Code: Select all
#ifndef RPG_H
#define RPG_H
//Headers
#include <Irrlicht.h>
#include <iostream>
//Game headers
#include "mnuMain.h"
//Name spaces to use
//Irrlicht Engine
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
//Microsofts
using namespace std;
//libraries
#pragma comment(lib, "Irrlicht.lib")
//Definitions
#define gameName "RPG DEBUG"
extern IrrlichtDevice *device;
#endif
mnuMain.h
Code: Select all
#include "RPG.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
class mnuMainEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if ( event.EventType = EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();
}
return false;
}
};
Thanks.