Page 1 of 2

I'm getting a linker error...

Posted: Thu Jul 28, 2005 7:35 pm
by omega3d
This is probably really common, but when I did a forum search I found nothing. Here's what the error says:

[Linker error] undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKw'

Then I tried compiling the Hello World example... well, I got the same error but in a different, weirder form. This time the program actually compiled, but when I ran it I got an error window saying:

The procedure entry point
_ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimention2dIiEEjbbbPNS_14IEventReceiverEPKw could not be located in the dynamic link library Irrlicht.dll.

Yes, the executable was put into a directory with Irrlicht.dll in it.

I'm using Dev-C++ 4.9.9.0 with Windows XP. What's going on?

Posted: Thu Jul 28, 2005 9:49 pm
by Midnight
while compiling it's not important that the .dll is anywhere near the .exe only that it's in your defualt project path.. for example.


project/game.dev
project/debug/game.exe
project/irrlicht.dll


get the idea? check the .dll check your code use a console to debug.

I don't use dev and I have never seen this error before but it relates to a very common error yes.

you could also check you windows directory for an old .dll or something you're on your own with this sorry.

Posted: Thu Jul 28, 2005 11:01 pm
by Fred
The location of the DLL has nothing to do with linking. Make sure you don't have older copies of Irrlicht's library lying around - it may be linking against 0.10 and running against 0.11.

Posted: Fri Jul 29, 2005 2:33 pm
by MindGames
You link against the lib file not the dll. You run using the dll. The line

Code: Select all

#pragma comment(lib, "Irrlicht.lib")
tells the compiler to link using the specified library. As this is coded, it will use the lib file in the directory local to your program. If it cannot find it there, it will look in the lib directories specified in your compiler. You can modify this to use a different path if you wish e.g.

Code: Select all

#pragma comment(lib, "c:\MyLibs\Irrlicht.lib")
which specifies its location.

Put the dll that you want used in same directory as the executable generated. Make sure that the versions of the lib and dll match.

As to old versions of the dlls, my advice on a dll with as specific a use as Irrlicht's, if you don't want them for backup purposes or anything, delete them. If for some reason you want to retain them, zip them up. Nothing more annoying than trying to deal with version errors in dlls.

Posted: Sat Jul 30, 2005 2:52 am
by Guest
MindGames wrote: Put the dll that you want used in same directory as the executable generated. Make sure that the versions of the lib and dll match.
Is there any specific thing I can do to figure that out? I only ever downloaded irrlicht once.

Posted: Sat Jul 30, 2005 2:59 am
by Guest
Fred wrote:The location of the DLL has nothing to do with linking. Make sure you don't have older copies of Irrlicht's library lying around - it may be linking against 0.10 and running against 0.11.
But the other program gave this error:

The procedure entry point
_ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimention2dIiEEjbbbPNS_14IEventReceiverEPKw could not be located in the dynamic link library Irrlicht.dll.

It says something about Irrlicht.dll at the end.

Posted: Sat Jul 30, 2005 11:10 am
by MindGames
There's no versioning in the dll so you cannot tell what version it is except by last modified date. However if you have only downloaded things once that cannot be your problem.

Just to clear a couple of things up;

If you go to the ...\bin\Win32-VisualStudio directory (I assume you are on windows) and run one of the executables, does it work? If it doesn't, I think you must have a corrupt download - download it again.

Have you recompiled the Irrlicht dll yourself or are you using the one that came with the download?

Posted: Sat Jul 30, 2005 2:49 pm
by lincsimp
#pragma comment(lib, "Irrlicht.lib")

will do NOTHING in mingw(dev-cpp). You are probably missing a line like this in your linker parameters:

-L"../../lib/Win32-gcc/libIrrlicht.a"

hope that helps

Posted: Sat Jul 30, 2005 6:55 pm
by Guest
MindGames wrote:If you go to the ...\bin\Win32-VisualStudio directory (I assume you are on windows) and run one of the executables, does it work? If it doesn't, I think you must have a corrupt download - download it again.
Yes, the precompiled ones work, but if I try to compile my own it doesn't work.
MindGames wrote:Have you recompiled the Irrlicht dll yourself or are you using the one that came with the download?
I'm using the one that came with the download. I dont even know how to compile my own.
linksimp wrote:hope that helps
It did! But now I'm getting the prompt about the DLL file.
The procedure entry point
_ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimention2dIiEEjbbbPNS_14IEventReceiverEPKw could not be located in the dynamic link library Irrlicht.dll.

Here's my syntax of the createDevice command:

Code: Select all

IrrlichtDevice *device =
		createDevice(EDT_OPENGL, core::dimension2d<s32>(640, 480));
I have these namespaces (the core namespace was left out because it interferes with the string header):

Code: Select all

using namespace std;
using namespace irr;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
Any ideas anybody?

Posted: Sat Jul 30, 2005 7:05 pm
by lincsimp
hmm.. does the tutorial compile without any modifications to the source (ie without string stuff and missing core namespace)?

Posted: Sat Jul 30, 2005 7:13 pm
by Guest
lincsimp wrote:hmm.. does the tutorial compile without any modifications to the source (ie without string stuff and missing core namespace)?
I see where you're getting with this. I'll try it out, but it might take a while.

Posted: Sat Jul 30, 2005 7:14 pm
by Guest
Anonymous wrote:
lincsimp wrote:hmm.. does the tutorial compile without any modifications to the source (ie without string stuff and missing core namespace)?
I see where you're getting with this. I'll try it out, but it might take a while.
Wait a minute... no. None of the tutorials with compile.

Posted: Sat Jul 30, 2005 8:09 pm
by MikeR
If you are using Dev-Cpp, follow the link in my sig to compile the tutorials. It's a tutorial for compiling irrlicht tutorials with Dev-Cpp.
It sounds like you aren't setting up your compiler correctly.

Posted: Sat Jul 30, 2005 9:19 pm
by dawasw
I had almost same problem i think i switched the library from irrlicht 0.10 to older one 0.9 and everything ran ok. But i think you have already solved everything out thanks to great MikeR tutorial :D

Posted: Sat Jul 30, 2005 10:32 pm
by Guest
That helps a little... but I'm still getting this error.

The procedure entry point
_ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimention2dIiEEjbbbPNS_14IEventReceiverEPKw could not be located in the dynamic link library Irrlicht.dll.