Don't compiling...

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
Gideon
Posts: 26
Joined: Sat Oct 25, 2008 11:28 am
Location: Russian
Contact:

Don't compiling...

Post by Gideon »

Hi to all. My simple code:

Code: Select all

#include <irrlicht.h>

using namespace irr; 

#pragma comment(lib, "Irrlicht.lib")

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

int main()
{
   IrrlichtDevice *device =
                createDevice(EDT_OPENGL, dimension2d<s32>(1024, 580), 16, false, false, false, 0);
   if (device == 0) 
            return 1; 
   device->setWindowCaption(L"GoD forever! | Our games the games of games! | Да, да! Мы крутые!+))");
   IVideoDriver* driver = device->getVideoDriver(); 
   ISceneManager* scene = device->getSceneManager();
   device->getFileSystem()->addZipFileArchive("C:/Documents and Settings/Neo/Рабочий стол/gently caress.zip");
   IAnimatedMesh* mesh = smgr->getMesh("map(1,2).b3d");
   ISceneNode* node = 0; 
   if (mesh)
   node = scene->addOctTreeSceneNode(mesh->getMesh(0));
   scene->addSkyBoxSceneNode( 
                                  driver->getTexture("C:/Documents and Settings/Neo/Рабочий стол/Кидай/irrlicht-1.4.2/irrlicht-1.4.2/media/irrlicht2_up.jpg"), 
                                  driver->getTexture("C:/Documents and Settings/Neo/Рабочий стол/Кидай/irrlicht-1.4.2/irrlicht-1.4.2/media/irrlicht2_dn.jpg"), 
                                  driver->getTexture("C:/Documents and Settings/Neo/Рабочий стол/Кидай/irrlicht-1.4.2/irrlicht-1.4.2/media/media/irrlicht2_lf.jpg"), 
                                  driver->getTexture("C:/Documents and Settings/Neo/Рабочий стол/Кидай/irrlicht-1.4.2/irrlicht-1.4.2/media/media/irrlicht2_rt.jpg"), 
                                  driver->getTexture("C:/Documents and Settings/Neo/Рабочий стол/Кидай/irrlicht-1.4.2/irrlicht-1.4.2/media/media/irrlicht2_ft.jpg"), 
                                  driver->getTexture("C:/Documents and Settings/Neo/Рабочий стол/Кидай/irrlicht-1.4.2/irrlicht-1.4.2/media/media/irrlicht2_bk.jpg"));
   ITriangleSelector* selector = 0;
   if (node)
   {        
         node->setPosition(vector3df(0,-1,0));
         selector = scene->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
         node->setTriangleSelector(selector);
   }
   cam->setPosition(core::vector3df(42,115,11)); 
   cam->setTarget(core::vector3df(0,0,0));
   if (selector)
   {
       ISceneNodeAnimator* anim = scene->createCollisionResponseAnimator(
       selector, cam, vector3df(30,50,30), vector3df(0,-3,0), vector3df(0,50,0));
       selector->drop();
       cam->addAnimator(anim);
       anim->drop();
   }
        device->getCursorControl()->setVisible(false); 
        scene->addLightSceneNode(0, vector3df(-60,100,400), SColorf(1.0f,1.0f,1.0f,1.0f), 600.0f);

        int lastFPS = -1; 
        while(device->run()) 
        if (device->isWindowActive())
        {
                driver->beginScene(true, true, 0);
                scene->drawAll();
                line3d<f32> line; 
                line.start = cam->getPosition(); 
                line.end = line.start + (cam->getTarget() - line.start).normalize() * 1000.0f;

                vector3df intersection;
                triangle3df tri;

                if (scene->getSceneCollisionManager()->getCollisionPoint(
                        line, selector, intersection, tri))
                {
                        driver->setTransform(ETS_WORLD, matrix4());
                        driver->draw3DTriangle(tri, SColor(0,255,0,0));
                }
                driver->endScene();

                int fps = driver->getFPS();

                if (lastFPS != fps)
                {
                        stringw str = L"Да вот специально не напишу тут ничего!+) [";
                        str += driver->getName();
                        str += "] FPS:";
                        str += fps;
                        device->setWindowCaption(str.c_str());
                        lastFPS = fps;
                }
        }
        device->drop(); 
        return 0;
}
I compiling this code in Dev-C++ and I does not got the good result...
Problem(written in the Errors Block):
irrlicht.h: No such file or directory.
All right, I had been the bad include the "include files" in the options of my projects. But I have the other project with analog code. When compiling it, all good. When I compiling THIS code in one, I got this text in "Errors block":

Code: Select all

 Illegal byte sequence 
[Build Error]  [obj/main.o] Error 1 
What problem I have?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Might be a wrong Dev-C++ version. You have to use the 5.0 beta (4.9.9.2), otherwise all bad things will happen. Or you used some UTF bytecode in your code, maybe some variable with non-ASCII names?
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

Yeah may be that, try building it in Code::blocks compiler.
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
Gideon
Posts: 26
Joined: Sat Oct 25, 2008 11:28 am
Location: Russian
Contact:

Post by Gideon »

But I use the namespaces...
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
I have Dev-C++ 4.9.9.2.............
Gideon
Posts: 26
Joined: Sat Oct 25, 2008 11:28 am
Location: Russian
Contact:

Post by Gideon »

Image
In second line:
C:\Documents and Settings\Neo\Рабочий стол\Кидай\irrlicht-1.4.2\irrlicht-1.4.2\examples\02.Quake3Map\Makefile.win
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

sorry but doesn't it have actually problem with cirill characters?
i have japanese windows, and i can't write japanese characters in my code...
try to remove them, and check what happens
Image
Image
Gideon
Posts: 26
Joined: Sat Oct 25, 2008 11:28 am
Location: Russian
Contact:

Post by Gideon »

Nothing… It does’t meter...
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

did you try out?
Image
Image
Gideon
Posts: 26
Joined: Sat Oct 25, 2008 11:28 am
Location: Russian
Contact:

Post by Gideon »

Yes... :cry:
Post Reply