I would like to compile my game for Windows, and i would like to do that from a linux host (cross compiling). Thus, i installed MinGW. A first hello Windows test worked fine
Now i want to compile one of the irrlicht tutorials, before bothering to compile my game.
I stumbled over the libraries for Windows. In lib/Win32-gcc i discovered two files:
libIrrlicht.a and libIrrlicht.def. A few questions arose:
What is libIrrlicht.def for?
Why is libIrrlicht.a so small (about 10kb)?
Then i had a look in bin/Win32-gcc and discovered a file Irrlicht.dll. This file has a size of
about 5mb. Which file to use now?
Why is the linux lib so much bigger (about 37mb)?
What about all the other libs, i need to link in when compiling for linux?
These might be stupid questions, sorry, but i've never programmed nor compiled anything for Windows and i don't know, how the thing with the libraries work there.
Compiling a tutorial for Windows with gcc/MinGW
-
- Posts: 58
- Joined: Tue Apr 10, 2007 7:49 pm
- Location: Karlsruhe
You have to link with the libIrrlicht.a and put the Irrlicht.dll into the same folder as the exe of your program.
The libIrrlicht.a is so small because the code of the engine is in the DLL. The library just tells the linker that the DLL has this code.
The def file is afaik for linking the engine by hand or something. I never needed or used the def files.
Why the linux lib is so much bigger? Well I have to guess but I'd say that it includes the runtime library and other things that are already present on a windows installation and can be dynamicly loaded. But I don't know for sure.
The libIrrlicht.a is so small because the code of the engine is in the DLL. The library just tells the linker that the DLL has this code.
The def file is afaik for linking the engine by hand or something. I never needed or used the def files.
Why the linux lib is so much bigger? Well I have to guess but I'd say that it includes the runtime library and other things that are already present on a windows installation and can be dynamicly loaded. But I don't know for sure.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
-
- Posts: 58
- Joined: Tue Apr 10, 2007 7:49 pm
- Location: Karlsruhe
Thanks for your explanations.
I managed to compile the TerrainRendering Tutorial for Windows. This was actually quiet
easy, i just had to specifie the compiler to use in the Makefile:
Then i run the resulting executible with wine and made a very interesting discovery:
While the TerrainRendering Demo compiled natively for linux runs with about 200-250 FPS,
the one for windows runs - wrapped with wine - with about 350-400 FPS. In both cases i've
chosen to render using opengl.
Any ideas, why this is so? This kind of makes irrlicht being cross-platform almost pointless,
when i get a better experience with a windows executible wrapped with wine, then with a
native executible.
I managed to compile the TerrainRendering Tutorial for Windows. This was actually quiet
easy, i just had to specifie the compiler to use in the Makefile:
Code: Select all
all_win32: CXX = i586-mingw32msvc-g++
While the TerrainRendering Demo compiled natively for linux runs with about 200-250 FPS,
the one for windows runs - wrapped with wine - with about 350-400 FPS. In both cases i've
chosen to render using opengl.
Any ideas, why this is so? This kind of makes irrlicht being cross-platform almost pointless,
when i get a better experience with a windows executible wrapped with wine, then with a
native executible.
200 fp to 400 fps is not really a big difference (2-3 ms), so that could really be caused by lots of factors, so unless there's a serious difference I wouldn't care too much. My experience with wine so far was that it generally was always around the same speed than the native linux version. Which is not that suprising as pure 3D applications are mostly dependend on the graphic-card. But you might like native linux clients as soon as you do more than just pushing polygons to the graphic card.
I can't do cross-platform to compare as the corresponding i586-mingw32msvc libstdc++ which is currently in debian does define some _powf when it shouldn't :-(
I can't do cross-platform to compare as the corresponding i586-mingw32msvc libstdc++ which is currently in debian does define some _powf when it shouldn't :-(
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 58
- Joined: Tue Apr 10, 2007 7:49 pm
- Location: Karlsruhe