Game Programming and Development Tools

IrrKlang problems – Lazarus

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
I was attempting to compile the example program that comes with IrrKlang(irrklang.irrlicht3d.org) and every time it gives me a linker error:

[Linker error] undefined reference to `_imp___ZN3irr5audio20createIrrKlangDeviceENS0_21E_SOUND_OUTPUT_DRIVEREbbPKc'
ld returned 1 exit status
C:\Dev-Cpp\irrklang1\Makefile.win [Build Error] [irrklang1.exe] Error 1

The IrrKlang.lib file is being linked to in the Project Options/Parameters location, the headers directory was specified, the dll is in the right place, and I can't figure it out.

Does anyone know why this would be happening? I'd appreciate some help.

(btw, Dev-Cpp choked on the header files because some of them didn't have newlines at the bottom. So had to do that first)

Laz

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
if the 'createIrrKlangDevice' is your first library call then its most likely that you didn't include the library file (typically the .lib file) for DevC++ I believe they need a .o file for the library file, just include that if IrrKlang comes with a DevC++ setup...

------------------
www.auran.com

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
That could be a problem then . IrrKlang only comes with a .lib file and no source to recompile from.

Lazarus

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
yeah, well Irrlicht is cross platform, so there may also be multiple compiler builds of it. Hopefully Steve will have the answer, he is very knowledgable with Irrlicht.

Just those specific linker errors are normally to do with not linking to the library, as it finds the declaration (function prototype) in the header files, so it compiles fine, but then when it goes to link the project (turn .obj files into the actual .exe), it cannot find the library to which your specifying, and so cannot find the body to that function call... Well at least thats my interpretation of it, please correct me if I'm wrong...

------------------
www.auran.com

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
That was my understanding of it too, just didn't know why Dev-C++ wouldn't link with the Irrklang.lib file.

I'll probably just have to download Microsoft C++ Express 2005, but on dialup... I've gotten to 1.7%, 1 day and 17 hours remaining.

Laz

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Well, Dev-Cpp uses imported Gnu compilers and linkers. These create and link libraries with a totally different format than Microsoft's compiler.

Using Google, I found this tool reimp that supposedly converts .lib files into something that MinGW (Dev-cpp's compiler) can use. I think it creates .a files that you can link to.

------------------
+---------+
|steveth45|
+---------+

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Thanks Steve, I'll check it out.
Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Weird. reimp converted it fine. but it still gives the same error .

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
did you include that library with your project?

------------------
www.auran.com

Lazarus

Member

Posts: 1668
From: USA
Registered: 06-06-2006
Yes. Parameters section of project options, just like always.

Meh, Dev-C++ never works right for me.

Laz