Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge several native DLLs into one DLL

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.

like image 465
Motti Avatar asked Sep 28 '08 08:09

Motti


People also ask

How do I combine dll files?

A lib file for a dll has no executable code. Yes, it is impossible to merge dll files; there is no tool to do it and it cannot be done manually either.

What are dll files used for?

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Each program can use the functionality that is contained in this DLL to implement an Open dialog box.


2 Answers

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.

like image 124
Kasprzol Avatar answered Oct 04 '22 13:10

Kasprzol


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.

like image 36
xardias Avatar answered Oct 04 '22 13:10

xardias