views:

3367

answers:

6

I've got a lot of small DLLs which I would like to make into one big(er) DLL (as suggested here). I can do so by merging my projects but I would like a less intrusive way.

Can several DLLs be merged into one unit?

A quick search found this thread that claims this is not possible. Does anyone know otherwise?

Note that I'm talking about native C++ code not .NET so ILMerge is out.

+2  A: 

I don't know about merging dlls, but I'm sure you can link the intermediate object files into one dll. This would only require changes in your build script.

Kasprzol
+1  A: 

As far as I know you cannot merge DLL files directly. But it should be possible with static libraries or object files. If it is possible for you to build static libraries of your projects you can merge them using the Library Manager by extracting object files from all libraries and packaging them into a new library.

xardias
A: 

Also, there was a product that made a .LIB out of .DLLs. You could then link your exe against that .LIB and get rid of the .DLLs altogether. Perhaps you could link a .DLL out of the .LIB - I'm not sure.

The product is here: http://www.binary-soft.com/dll2lib/dll2lib.htm I'm not sure, if it works anymore, if it's supported or even sold. It sure appears pricey, but it used to have (nag-enabled) free trial period.

A: 

http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx

This is only for managed code, the question was about native.
Motti
+2  A: 

Just go to http://csharpdemos.blogspot.com/2010/03/exe-dll-merger.html and you will got everything you want !

Krishan Gahlot
It says it merges DLLs into an EXE, can it also output a DLL? Also is this managed only or does it support native DLLs too?
Motti
i created it to output an exe and i used it juss for managed exe n dlls !But I'm working on it and soon you'll see dll output function in that !And also let me tell you that im a student n a c sharp addict :-)
Krishan Gahlot
A: 

According to my knowledge, there is NO way to merge native unmanaged DLLs into one.

Unless those DLLs were built with "/CLR" (which means they are no-longer pure "native").

Feel sorry about that.

Passby2009