Any idee whats wrong?

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
bluebunny76
Posts: 4
Joined: Wed Oct 28, 2009 11:53 pm

Any idee whats wrong?

Post by bluebunny76 »

video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;

im using Dev-C++ and it says 'video' has not been declared ??

is ther something i need ??

My installs
Dev-C++ "devcpp-4.9.9.2_nomingw_setup.exe"
Irrlicht "irrlicht-1.6.zip"

The "Project options" (setting the dir) i used the Tutorial on the web page...

Microsoft Windows XP Professional
5.1.2600 Service Pack 3 Build 2600
X86-based PC
x86 Family 15 Model 6 Stepping 4 GenuineIntel ~3400
Hardware Abstraction Layer
Version = "5.1.2600.5508 xpsp.080320-1628
DirectX 9.0c (4.0.9.0000.0904)
NIVIDIA GeForce 8800GT Driver version 6.14.0011.7824
Also i have .net framework up to 3.5
Last edited by bluebunny76 on Thu Oct 29, 2009 7:08 am, edited 2 times in total.
tsurugi
Posts: 3
Joined: Sat Oct 24, 2009 12:31 am

Post by tsurugi »

Make sure you're using

Code: Select all

using namespace irr;
and make sure you included "Irrlicht.h". If you did both, then I'm not sure what the problem is.
bluebunny76
Posts: 4
Joined: Wed Oct 28, 2009 11:53 pm

About ^

Post by bluebunny76 »

I searched on google... and so on do i realy have to install DirectX SDK from microsoft? its 500mb Sad is'nt ther some other way to get the needed files? thats smaller??
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

no, you don't need to install DX SDK in this case.
just compiler can't see a "video" namespace, because as it was answered early you don't use namespace "irr". So, try:
1) add "using namespace irr;" string before your functions in the .cpp file
or
2) use irr::video instead video keywords
Good luck
bluebunny76
Posts: 4
Joined: Wed Oct 28, 2009 11:53 pm

Ok ?? Sorry but i am...

Post by bluebunny76 »

Code: Select all

#include <irrlicht.h>

using namespace irr;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")

int main()
{   
    IrrlichtDevice *device =
             createDevice(irr::video::EDT_SOFTWARE, dimension2d<u32>(640, 480) 16,
                   false, false, false, 0);
                   
           if (!device)
              return 1;
              
           device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
           
    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getScenceManager();
    IGUIEnviroment* guienv = device->getGUIEnviroment();
    
     guienv->addStaticText(L"Hello World! This is the Irrlicht OpenGL render!",
                                   rect<s32>(10,10,260,22), true);
                                   
     device->drop();
     return 0;
}     
12 C:\Projects\Untitled2.cpp expected primary-expression before '>' token
20 C:\Projects\Untitled2.cpp `IVideoDriver' undeclared (first use this function)
20 C:\Projects\Untitled2.cpp `driver' undeclared (first use this function)
21 C:\Projects\Untitled2.cpp `IGUIEnviroment' undeclared (first use this function)
21 C:\Projects\Untitled2.cpp `guienv' undeclared (first use this function)
[/img]

Is it coz im using irrlicht-1.6??
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Ok ?? Sorry but i am...

Post by CuteAlien »

bluebunny76 wrote: Is it because I'm using irrlicht-1.6?
No, it is because you haven't read up on namespaces yet in your c++ book. Do that. Then either add corresponding namespaces before each variable or do it like the Irrlicht examples and add all the typical namespaces of Irrlicht at the start of your program.

A more extensive explanation can be found when you read through the source of example 01 "Hello World" which can be found in the examples folder of Irrlicht.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply