Linker error DEV C++

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
Ultraporing
Posts: 34
Joined: Tue Nov 06, 2007 7:22 pm
Location: Würzburg, Germany

Linker error DEV C++

Post by Ultraporing »

Hi, guys.
I tryed the Hello World Tutorial and i use Dev C++ but i got this error.

C:\Dev-Cpp\main.o(.text+0x9b) In function `ZN3irr4core12irrAllocatorIcE12internal_newEj':
[Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc'
C:\Dev-Cpp\main.o(.text+0x9b) ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] [Test.exe] Error 1

here is my code:

Code: Select all

// Includes

#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")

//Anfang

int main()
{
    IrrlichtDevice *device =
		createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 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 engine!",
            rect<int>(10,10,200,22), true);
    
    IAnimatedMesh* mesh = smgr->getMesh("/media/sydney.md2");
    IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
    
    if (node)
    {
             node->setMaterialFlag(EMF_LIGHTING, false);
             node->setFrameLoop(0, 310);
             node->setMaterialTexture( 0, driver->getTexture("/media/sydney.bmp") );
    }
    
    smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
    
    while(device->run())
    {
   	driver->beginScene(true, true, SColor(255,100,101,140));

	smgr->drawAll();

	guienv->drawAll();

	driver->endScene();    
    }    
      
    device->drop();  
      
    return 0;
}
Can anyone help me?
thx
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hey, don't you think that anyone else would have had such a problem if it were a real bug :?:
There's the search button only some centimeters above this message :idea:
Oh, just a short hint because it's your first question: It's related to linking Irrlicht.lib to your app (though not with the visual studio compiler...)
Ultraporing
Posts: 34
Joined: Tue Nov 06, 2007 7:22 pm
Location: Würzburg, Germany

Post by Ultraporing »

-.- I used the search button but dont find this problem anywhere.
roguelike
Posts: 14
Joined: Tue May 30, 2006 11:03 am

Post by roguelike »

Dev C++ uses a different lib and dll to the Visual Studio one.

The lib is called libIrrlicht.a as hybrid mentioned and is in the lib/Win32-gcc folder.

You will need to link to that in your project settings.

When you run it, make sure you have the correct dll in the same folder as the .exe also
________
Hash Honey Oil
Last edited by roguelike on Tue Feb 22, 2011 10:50 pm, edited 1 time in total.
Ultraporing
Posts: 34
Joined: Tue Nov 06, 2007 7:22 pm
Location: Würzburg, Germany

Post by Ultraporing »

thx its work :) .
Post Reply