merge DLL in EXE

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

merge DLL in EXE

Post by EvIl_DeViL »

hi to all! does anyone know a way to merge a dll file into the main exe?
(possibly freeware)
many programs that do this thing are for .NET... i want something for C++
NeRoX
Posts: 12
Joined: Fri Jul 11, 2008 8:15 pm

Post by NeRoX »

Put the DLL into a binary resource and use LoadResource to access it. There are samples around somewhere.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Dll's are dynamic link libraries. If you want the library in your executable you will have to link statically. It's usually a linker option, but I haven't tried to link Irrlicht statically so far, so not sure if that will currently work without problems.
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
NeRoX
Posts: 12
Joined: Fri Jul 11, 2008 8:15 pm

Post by NeRoX »

Oh, thought closed-source dll... If you want Irrlicht DLL or any other Open Source DLL you can just put their source & header files into your project..
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

Post by EvIl_DeViL »

@ NeRoX: i'm talking also about d3dx8.dll, d3dx9.dll and audiere.dll...
you know... 4 .dlls i think are too much...
didn't find anything in dev-cpp about to link dll...
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

something like this one: http://www.molebox.com/ (just a random google)

not sure if there are any free ones.
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

do you want to embed the dll into your .exe so you don't have to ship it, or do you want to just link to it? You can do both with Dev-C++ :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

4 .dlls isn't really too much... it may not look as clean as you'd like having those lying around but lots of applications use many more .dlls.

And it's not going to save you any physical space by sticking them in your .exe as they'll just add that much more size, it'll basically just hide them from sight which is only really necessary if you're incredibly anal :lol:

Personally i wanted to do this before as i thought it was ugly having all the .dlls lying around but then i figured it didn't really matter and gave up on the idea.

But as has been suggested you'll want to create a static lib of irrlicht to do this and also compile in DX statically to irrlicht, if possible :lol:

For audiere i'm not sure if it's open source so you might have to use one of the other suggestions for that.
Image Image Image
lostclimategames
Posts: 331
Joined: Sat Sep 02, 2006 4:11 am
Location: Michigan
Contact:

Post by lostclimategames »

I personally think that dll's seem more professional, makes it look like you didnt just use some point and click "make a game in 30 minutes" programs. It makes it feel that you worked on it researched the software libraries you needed, linked them together with your own programming to create your very own application.
___________________________
For all of your 3D/2D resource needs:
Image
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

embeding dlls is simple.
u just define them as resource and then load them. problem is then u have to load the function u want to use as well
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

alternatively, you can use a gcc program to create a static library from the dll (no source code needed) and then just link to the static library; this allows you not to have to specify the load functions :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

yeah he is right forgot about that option
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
EvIl_DeViL
Posts: 89
Joined: Tue Nov 06, 2007 4:49 pm

Post by EvIl_DeViL »

so you mean i should use C:\Dev-Cpp\bin\dlltool.exe?
for example... what syntax i have to use to convert for example d3dx9.dll in a .lib? i used

dlltool -l libD3dx9.lib

but it create only 2Kb file...
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

From a cursory glance, it appears that dlltool only creates an import library for the dll, not a static version of the dll.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

It's tricky to get working, and you actually have to run at least two commands if I remember correctly; unfortunately I've lost my notes I took when I was doing this, so you'll have to look it up yourself I'm afraid :(
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
Post Reply