Code: Select all
// HelloUniverse.cpp
// Include the Irrlicht header
#include "irrlicht.h"
// Irrlicht Namespaces
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main()
{
IrrlichtDevice *irrDevice = createDevice(EDT_SOFTWARE,
dimension2d<s32>(512, 384),
16,
false,
false,
0);//->>ERROR LINE : 21
irrDevice->setWindowCaption(L"Dev-C++ and the Irrlicht Engine!");
IVideoDriver* irrDriver = irrDevice->getVideoDriver();
ISceneManager* irrSceneMgr = irrDevice->getSceneManager();
IGUIEnvironment* irrGUIEnv = irrDevice->getGUIEnvironment();
irrGUIEnv->addStaticText(
L"Hello World! This is the Irrlicht software engine!",
rect<int>(10,10,200,30), true, true, 0, -1);
while(irrDevice->run())
{
irrDriver->beginScene(true, true, SColor(0,192,192,192));
irrSceneMgr->drawAll();
irrGUIEnv->drawAll();
irrDriver->endScene();
}
irrDevice->drop();
return(0);
}Looks like the error come from irrlicht header too.C:\Dev-Cpp\irrdemo.cpp In function `int main()':
21 C:\Dev-Cpp\irrdemo.cpp invalid initialization of reference of type 'const irr::core::dimension2d<irr::u32>&' from expression of type 'irr::core::dimension2d<irr::s32>'
329 C:\irrlicht-1.7.2\irrlicht-1.7.2\include\irrlicht.h in passing argument 2 of `irr::IrrlichtDevice* irr::createDevice(irr::video::E_DRIVER_TYPE, const irr::core::dimension2d<irr::u32>&, irr::u32, bool, bool, bool, irr::IEventReceiver*)'
C:\Dev-Cpp\Makefile.win [Build Error] [irrdemo.o] Error 1
I followed from this tutorial :
http://irrlicht.sourceforge.net/tut_devcpp.html
please help
