Strange Link error

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
klaim
Posts: 3
Joined: Tue Sep 06, 2005 12:20 pm

Strange Link error

Post by klaim »

Hello!

I downloaded the last release of irrlicht to test some things, because i think i'll use it for my project.

So, i created a simple console project with VS2005 and i set the include directory, the lib directory and add Irrlicht.lib as additional lib.

Then i compile this code:(the code is from the example in the first page of the online documentation)

Code: Select all


#include <irrlicht.h>
 using namespace irr;

int main()
{
	// start up the engine
       IrrlichtDevice *device = createDevice(video::EDT_DIRECTX8,
                core::dimension2d<s32>(640,480));

        video::IVideoDriver* driver = device->getVideoDriver();
        scene::ISceneManager* scenemgr = device->getSceneManager();

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


		// draw everything
        while(device->run() && driver)
        {
                driver->beginScene(true, true, video::SColor(255,0,0,255));
                scenemgr->drawAll();
                driver->endScene();
        }

        // delete device
        device->drop();
        return 0;


}
And i have this error:

Code: Select all

error LNK2019: unresolved external symbol __imp_?createDevice@irr@@YAPAVIrrlichtDevice@1@W4E_DRIVER_TYPE@video@1@ABV?$dimension2d@H@core@1@I_N22PAVIEventReceiver@1@PB_W@Z referenced in function _main	Main.obj
Then, i tried to see if it compile without the call to createDevice, and it works. (Before compilation i put the Irrlicht.dll in the build directory)

So i think maybe this function is not exported or anything like that, or maybe i forgot to do something...

Can someone help me?

Thanks!
(Sorry for my poor english (i'm french))
klaim
Posts: 3
Joined: Tue Sep 06, 2005 12:20 pm

Post by klaim »

Well, it works (it can link) when i replace createDevice by createDeviceEx O__o.
I think it's very strange.


The code that works:

Code: Select all

#include <irrlicht.h>
 using namespace irr;

int main()
{


	 SIrrlichtCreationParameters param;
	 param.AntiAlias=false;
	 param.Bits=32;
	 param.DriverType=video::EDT_OPENGL;
	 param.EventReceiver=NULL;
	 param.SDK_version_do_not_use=IRRLICHT_SDK_VERSION;
	 param.Stencilbuffer=false;
	 param.Vsync=false;
	 param.WindowId=NULL;

	// start up the engine
	IrrlichtDevice *device = createDeviceEx(param);

        video::IVideoDriver* driver = device->getVideoDriver();
        scene::ISceneManager* scenemgr = device->getSceneManager();

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


		// draw everything
        while(device->run() && driver)
        {
                driver->beginScene(true, true, video::SColor(255,0,0,255));
                scenemgr->drawAll();
                driver->endScene();
        }

        // delete device
        device->drop();
        return 0;


}

While i think the problem with createDevice is from the lib, i'll use createDeviceEx for now...
Or mybe rebuild the Irrlicht project...
Post Reply