Upgrading to 0.4.2

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.
Descend
Posts: 10
Joined: Tue Sep 09, 2003 8:37 pm

Upgrading to 0.4.2

Post by Descend »

I have just upgraded the version of Irrlicht I'm using to 0.4.2 and after some minor changes to my code, everything seems to compile. However I am now getting an unresolved external:

"MM error LNK2019: unresolved external symbol "__declspec(dllimport) class irr::IrrlichtDevice * __cdecl irr::createDevice(enum irr::video::EDriverType,class irr::core::dimension2d<int> const &,unsigned int,bool,bool,class irr::IEventReceiver *,wchar_t const *)" (__imp_?createDevice@irr@@YAPAVIrrlichtDevice@1@W4EDriverType@video@1@ABV?$dimension2d@H@core@1@I_N2PAVIEventReceiver@1@PB_W@Z) referenced in function "public: void __thiscall CClient::Run(void)" (?Run@CClient@@QAEXXZ)"


Any ideas??
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

can you please post your code for creating the device?
Descend
Posts: 10
Joined: Tue Sep 09, 2003 8:37 pm

Post by Descend »

Simply done with this line:

IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(WIDTH, HEIGHT), 32, false, false, receiver);

I have also tried changing the line to:

IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(WIDTH, HEIGHT), 32, false, false, receiver, IRRLICHT_SDK_VERSION);

WIDTH and HEIGHT are defined elsewhere but are currently 800 and 600 respectively.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

sounds like you're linking in the old 0.4.1 or 0.4.0 .lib file-- make sure you're linking in the new 0.4.2 file
a screen cap is worth 0x100000 DWORDS
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Descend wrote:Simply done with this line:

IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(WIDTH, HEIGHT), 32, false, false, receiver);

I have also tried changing the line to:

IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(WIDTH, HEIGHT), 32, false, false, receiver, IRRLICHT_SDK_VERSION);

WIDTH and HEIGHT are defined elsewhere but are currently 800 and 600 respectively.
Notice your device setup there...

IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(WIDTH, HEIGHT), 32, false, false, receiver, IRRLICHT_SDK_VERSION);

Now try this one...

IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(WIDTH, HEIGHT), 32, false, false, &receiver, IRRLICHT_SDK_VERSION);

The event reciever should be a pointer address of the reciever.
Programmer of the Irrlicht Scene Editor:
Homepage - Forum Thread
Version 2 on its way!!
Descend
Posts: 10
Joined: Tue Sep 09, 2003 8:37 pm

Post by Descend »

No, made sure that I'm linking in with the latest library, and the receiver I'm using is already a pointer...

Any other ideas?
Guest

Post by Guest »

Ok, I've been hacking around with this for hours now. It works perfectly if I compile it using the previous version 0.4.0 ... there must be something really simple I'm missing!

Its starting to do my head in...
Homer
Posts: 58
Joined: Tue Nov 18, 2003 7:11 pm
Location: Germany

Post by Homer »

hmm, have you copied the new version of the irrlicht dll to your win\system directory?
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

Guys, this is a "MM error LNK2019"--- a Link Error.
its not caused by the wrong .dll, or by a typo. its caused by not finding the offending function inside the .lib file.

there are only a number of things that could cause this:

1) its a 0.4 function which is not found in 0.4.2 .lib you say you are using
2) you're not actually using the 0.4.2 .lib (though you're probably using the 0.4.2 headers)
3) you're 'using' the 0.4.2 .lib, but you havent set up your project to properly include it-- since it cant find the .lib, you have a link error (but somewhere in the compile output it should say 'couldnt find included xxx.lib')
4) you have redefined the function header for some silly reason (not likely)

my money is on 3
a screen cap is worth 0x100000 DWORDS
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post by qwe »

keless, your Tetris game gives me the same link error. I have absolutely no idea what's going on, since all of my projects compile/run fine. :roll:
Descend
Posts: 10
Joined: Tue Sep 09, 2003 8:37 pm

Post by Descend »

I was thinking 3 too, but there are no missing library errors, it just simply cannot seem to find the function inside the library.

The only thing I've got to go on here is that it is looking for the function:
?createDevice@irr@@YAPAVIrrlichtDevice@1@W4EDriverType@video@1@ABV?$dimension2d@H@core@1@I_N2PAVIEventReceiver@1@PB_W@Z

But in the actual DLL (Opened using PE Viewer) the function is
?createDevice@irr@@YAPAVIrrlichtDevice@1@W4EDriverType@video@1@ABV?$dimension2d@H@core@1@I_N2PAVIEventReceiver@1@PBG@Z

Notice the only difference is PB_W and PBG ... I have no idea what that means though if it means anything at all!
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

I'm sure you've checked this while checking the other lib suggestions, but are you linking to the correct lib for your development platform?
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

yeah, are you using MSVC or DevCpp
keless, your Tetris game gives me the same link error. I have absolutely no idea what's going on, since all of my projects compile/run fine.
interesting-- I used both MSVC and DevCpp to build it, perhaps I left a .dll or .lib file belonging to the opposite IDE that you're using? I have not modified the engine in anyway, so you shouldnt have a problem if you havent either. (0.4.2)

I suppose ICE gives you the same error?
http://www.skyesurfer.net/keless/IrrLicht/ICE/
a screen cap is worth 0x100000 DWORDS
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post by qwe »

i'm using msvc.

no, i haven't tried that one. I will as soon as I can though.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

Ah, i found an easy (if hack-ish) solution:
In your SolutionExplorer, choose 'add existing item' and browse till you find the MSVC IrrLicht.lib file. select it (it is now included in your project tree).

Build, and wala!

With my Tetris and ICE src distributions, I have a folder called /dlls/MSVC/ which has both the .DLL and the .LIB -- (apparently this was the reason I included the .LIB)
a screen cap is worth 0x100000 DWORDS
Post Reply