ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Borland C++ Builder Contest

How to compile a program to not need any external dll and bpl files

(1/2) > >>

How to compile a BCB program to not need any external dll and bpl files:

When you compile a program in BCB or Delphi that you intend to share or distribute, you either want to include a bunch of required bpl and dll runtime library files, or indicate that the program should compile these into the main program.

Compiling these in will result in a bigger but more portable executable.

There are 2 things you need to set in your project.

* First, go to the project properties dialog, click on the Linker tab, and UNCHECK the "Use dynamic RTL" checkbox.
* Second, click on the Packages tab, and UNCHECK the "Build with runtime packages" checkbox at the bottom.
It may also be important to:

* Third, click on the CodeGuard tab, and UNCHECK the "CodeGruard Validation" checkbox.

Also remember to verify You have been successful with
Dependency walker for example:


great link c++speaker! i'm going to blog it in fact.


Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more.

Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules. Dependency Walker detects many common application problems such as missing modules, invalid modules, import/export mismatches, circular dependency errors, mismatched machine types of modules, and module initialization failures.

Dependency Walker runs on Windows 95, 98, Me, NT, 2000, XP, 2003, and Vista. It can process any 32-bit or 64-bit Windows module, including ones designed for Windows CE. It can be run as graphical application or as a console application. Dependency Walker handles all types of module dependencies, including implicit, explicit (dynamic / runtime), forwarded, delay-loaded, and injected. A detailed help is included.
--- End quote ---

I would personally recommend *against* this static linkage - it gives extreme code bloat, makes it impossible for processes to share the memory-hit of the runtime, etc.

Yes, it's a little more bother to redistribute the runtimes, but it's worth it. At the very least offer both static and dynamic linked versions...

I don't want to bring things off topic but I've a question related to distributing runtimes along with a program:- Will you always get the advantage of processes being able to share DLLs or those it only work if the DLLs are placed in the System directory?

I ask because I noticed recently on my PC that I’ve an awful lot of programs with contain say msvcr71.dll or equally popular ones within their own directories. Does windows spot that all these copies are identical and shares the memory or is each one loaded seperatly?


[0] Message Index

[#] Next page

Go to full version