Question about engine lib and dll

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
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Question about engine lib and dll

Post by cr_itm »

Hello,

I have a short question about compiling the engine. When I build it with Visual Studio, it creates a new dll. But what about the very small lib in the "./lib/VisualStudio" directory and for what is the file Irrlicht.exp? I mean, the sample projects link to the lib file, but the engine is a dll file?

You see, I'm a bit confused here :-)

Thanks for your help
Reverie
Posts: 6
Joined: Thu May 19, 2005 12:03 pm
Location: Minneapolis, MN
Contact:

Post by Reverie »

Hi!

When you compile the library yourself in Visual Studio, you have to tell the compiler what type of Library file you'd like. To me, it sounds like you are making it a "Dynamic Library" (.DLL)... you need to change that to a "Static Library" (.LIB)

If you're using .NET it's Project > Proj Properties > Config Properties > General > Proj Defaults > Config Type to set it.

The other (exp) i believe is for your debugger (but could be wrong).
Error 404
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Post by cr_itm »

Reverie wrote:When you compile the library yourself in Visual Studio, you have to tell the compiler what type of Library file you'd like. To me, it sounds like you are making it a "Dynamic Library" (.DLL)... you need to change that to a "Static Library" (.LIB)

If you're using .NET it's Project > Proj Properties > Config Properties > General > Proj Defaults > Config Type to set it.
Well, is this a discription about config. my compiler in general? Or do you talk about the Irrlicht Visual Studio project file?

I'm using the project file, that came with the source of Irrlicht, so I think the settings for the dll/lib are correct. I believe, it is correct that Visual Studio builds a dll. Even the sample projects use the lib ("#pragma comment(lib, "Irrlicht.lib")"), but they need also the DLL.

So if anyone knows the secret here, please help :-)
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Post by cr_itm »

Is there no one with some experience in compiling the engine? It would be really helpfull, if someone may please explain this dll / lib thing, described above :)

Thanks a lot!
hybrid

Post by hybrid »

The dll is needed during runtime. It is loaded by the application which uses Irrlicht (or whatever dll you need). Thus, any user of your application only needs the dll.
The developer of the application needs the additional lib file during linking with the library. It contains some informations on the functions provided by the library. That's the reason why you add the lib file to source code using some pragma instruction.
If you're using unix .so file sometimes you should remember that these contain both parts in one file, i.e. you use the shared library for linking and during runtime.
Guest

Post by Guest »

a question dude
ive seen this game build in irrlicht i think the title is treasure hunter where the main character is a penguin and on the games folder i dont see the engine dll in there. how is it posible?
hybrid

Post by hybrid »

You have to install Irrlicht seperately :!:
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Post by cr_itm »

So, when I write a new application that uses Irrlicht I must use the lib (#pragma comment(lib, "Irrlicht.lib")), but the user who runs the app just need the dll.

But one question for the linux compiler: in the example files, there is always an #pragma statement. As far as I know, these #pragma's are excklusive on the win32 plaform with Visual Studio.

But how does someone compile the examples under linux? Does the gcc/g++ compiler ignore the #pragma line in the code?

And one last point: when I compile the engine with Visual Studio, it is only 840 kb in size (release build) but the original dll file which comes with the examples is 1.348kb in size... can you explain why?

Thanks a lot!
Guest

Post by Guest »

my dll is only 630kb - codeblocks + msvctoolkit2003 (directx9) - no opengl/directx8 :) so with your dll there should be no problem
cr_itm
Posts: 57
Joined: Sun May 01, 2005 10:13 am

Post by cr_itm »

GFXstyLER wrote:no opengl/directx8 :) so with your dll there should be no problem
Oh, is there the possibility to build the dll without driectx support? Currently, I only use opengl so that my app also runs under linux.
darkraven
Posts: 29
Joined: Sat Mar 06, 2004 5:54 am
Location: Florida
Contact:

Post by darkraven »

This may work in not compiling directx in but I'm not totally sure. In the sources to irrlicht there is a header file called IrrCompileConfig.h In that file Just comment out the following. And in theory it should not compile directx stuff. But again I've never delt with vs as I use devcpp but I'm guessing it should.


#if (defined(_WIN32) || defined(_XBOX)) && \
(!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))

#define _IRR_COMPILE_WITH_DIRECTX_8_
#define _IRR_COMPILE_WITH_DIRECTX_9_

#endif
Post Reply