Page 1 of 1

Question about engine lib and dll

Posted: Fri May 20, 2005 7:15 pm
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

Posted: Sat May 21, 2005 8:08 am
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).

Posted: Sat May 21, 2005 9:55 am
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 :-)

Posted: Sun May 22, 2005 7:09 pm
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!

Posted: Sun May 22, 2005 7:31 pm
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.

Posted: Mon May 23, 2005 3:00 am
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?

Posted: Mon May 23, 2005 7:43 am
by hybrid
You have to install Irrlicht seperately :!:

Posted: Tue May 24, 2005 9:07 am
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!

Posted: Tue May 24, 2005 12:59 pm
by Guest
my dll is only 630kb - codeblocks + msvctoolkit2003 (directx9) - no opengl/directx8 :) so with your dll there should be no problem

Posted: Tue May 24, 2005 1:38 pm
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.

Posted: Wed May 25, 2005 12:43 am
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