I'm getting a linker 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.
omega3d

I'm getting a linker error...

Post 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?
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post 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.
Fred

Post 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.
MindGames
Posts: 32
Joined: Sat Jul 16, 2005 2:02 am

Post 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.
Guest

Post 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.
Guest

Post 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.
MindGames
Posts: 32
Joined: Sat Jul 16, 2005 2:02 am

Post 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?
lincsimp
Posts: 21
Joined: Sat Mar 12, 2005 10:11 pm

Post 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
Guest

Post 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?
lincsimp
Posts: 21
Joined: Sat Mar 12, 2005 10:11 pm

Post by lincsimp »

hmm.. does the tutorial compile without any modifications to the source (ie without string stuff and missing core namespace)?
Guest

Post 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.
Guest

Post 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.
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post 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.
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
dawasw
Posts: 357
Joined: Tue Aug 10, 2004 4:39 pm
Location: Poland

Post 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
Guest

Post 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.
Post Reply