Author Topic: Problems building an Irrlicht project  (Read 4393 times)

Virtual X

  • Guest
Problems building an Irrlicht project
« on: March 02, 2006, 05:05:48 pm »
Hi,

anyone know how to solve an Irrlicht build issue? when I try to build a project I get the following error, just to add, I was able to build this project before but now I can't, strange.

Project   : Irrlicht Project
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\My Documents\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
Linking console executable: Irrlicht.exe
.objs\main.o:main.cpp:(.text+0x66): undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings




Source Code:

#include <irrlicht.h>

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

using namespace irr;


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


int main()
{
   
        // This seems to be the problem, but I can't see anything wrong with it :(
   IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 16, false, false, false, 0);

   
   device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

   
   IVideoDriver* driver = device->getVideoDriver();
   ISceneManager* smgr = device->getSceneManager();
   IGUIEnvironment* guienv = device->getGUIEnvironment();

   
   guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
      rect<int>(10,10,200,22), true);

   
   IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
   IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

   
   if (node)
   {
      node->setMaterialFlag(EMF_LIGHTING, false);
      node->setFrameLoop(0, 310);
      node->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
   }

   
   smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));

   
   while(device->run())
   {
      
      driver->beginScene(true, true, SColor(0,0,0,0));

      smgr->drawAll();
      guienv->drawAll();

      driver->endScene();
   }

   
   device->drop();

   return 0;
}



 

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Problems building an Irrlicht project
« Reply #1 on: March 02, 2006, 05:54:23 pm »
Check the libraries you 're linking as well as the linker search dirs. Either you 're not linking with libirrlicht.a or you 're trying to link with a version that doesn't have this symbol...
Be patient!
This bug will be fixed soon...