set up dev c++ problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kim

set up dev c++ problem

Post by kim »

I use the tutorial on how to setup dev c++. I follow the tutorial when i try to compile i get this error. Could anyone help.. thanks

here is the problem:
// 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(DT_SOFTWARE,
dimension2d<s32>(512, 384),
16,
false,
false,
0);

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!",
true,
rect<int>(10,10,200,30));

while(irrDevice->run())
{
irrDriver->beginScene(true, true, SColor(0,192,192,192));

irrSceneMgr->drawAll();
irrGUIEnv->drawAll();

irrDriver->endScene();
}

irrDevice->drop();

return(0);
}

Error I get :


// 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(DT_SOFTWARE,
dimension2d<s32>(512, 384),
16,
false,
false,
0);

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!",
true,
rect<int>(10,10,200,30));

while(irrDevice->run())
{
irrDriver->beginScene(true, true, SColor(0,192,192,192));

irrSceneMgr->drawAll();
irrGUIEnv->drawAll();

irrDriver->endScene();
}

irrDevice->drop();

return(0);
}
kim

errors message

Post by kim »

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c hello.cpp -o hello.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/irrlicht-0.6/include"

hello.cpp: In function `int main()':
hello.cpp:16: `DT_SOFTWARE' undeclared (first use this function)
hello.cpp:16: (Each undeclared identifier is reported only once for each
function it appears in.)

hello.cpp:31: no matching function for call to `irr::gui::IGUIEnvironment::
addStaticText(const wchar_t[51], bool, irr::core::rect<s32>)'
C:/Dev-Cpp/irrlicht-0.6/include/IGUIEnvironment.h:178: candidates are: virtual

irr::gui::IGUIStaticText* irr::gui::IGUIEnvironment::addStaticText(const
wchar_t*, const irr::core::rect<s32>&, bool = false, bool = true,
irr::gui::IGUIElement* = 0, int = -1)

make.exe: *** [hello.o] Error 1

Execution terminated
MaekSA

devcpp tutorial fix code

Post by MaekSA »

This is the devcpp tutorial fix code.
I couldn't get the tutorial to compile and I made some changes.


// 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);

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 );

while(irrDevice->run())
{
irrDriver->beginScene(true, true, SColor(0,192,192,192));

irrSceneMgr->drawAll();
irrGUIEnv->drawAll();

irrDriver->endScene();
}

irrDevice->drop();

return(0);
}



Also if EDT_SOFTWARE gives you trouble change it to EDT_OPENGL
Post Reply