Static Lib - Cannot compile with the created library.

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
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Static Lib - Cannot compile with the created library.

Post by linkoraclehero »

I'm certain this issue lies within the new static lib option, as I've never had this issue before when compiling as a DLL, and the option appears to be fairly new. Anytime I try to compile a project with the static irrlicht library, I get the error:

main.obj : error LNK2019: unresolved external symbol __imp__createDevice referenced in function _main

It's obviously finding the library, otherwise it would error sooner stating that "irrlicht.lib" could not be found - and this is the only cause I could find to this error. I don't understand why this error is even occurring, createDevice was obviously compiled in, and at a whopping 95MB, it'd be silly for the library to be missing such a critical function yet include so much more.

I apologize if this issue is known, phpBB's search is awful, and Google has been going downhill for years.
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Post by linkoraclehero »

My mistake - after scanning the source code, I finally found the answer thanks to the 1 billion lines of comments -

// To build Irrlicht as a static library, you must define _IRR_STATIC_LIB_ in both the
// Irrlicht build, *and* in the user application, before #including <irrlicht.h>
Post Reply