Page 1 of 1

Linking all dependencies into a single executable file

PostPosted: Sun Jun 28, 2020 3:50 pm
by smd
RAD Studio 10.1

I have a program that I will be distributing around work for use by others. Currently I have to collect the various libraries and put everything into a folder which is then distributed. The program is a windows gui program written in C and C++ using Firemonkey.

How do I get the linker and/or compiler to combine all the various runtime libraries and such into a single file?

Re: Linking all dependencies into a single executable file

PostPosted: Mon Jun 29, 2020 5:03 am
by 2ffat
First, make certain that you have changed the compiler from Debug to Release.

Under the IDE, go to Project, then at the bottom select Options. The options form will pop up. On the left-hand side look for the C++ Linker option. On the right-hand side, look for Link with Dynamic RLT and click on the selection button to change from true to false. Then click on the Link with Delphi Runtime Library and click on the selection button to change it from true to false.

Finally, on the left-hand side look for the Packages option. Then select the Runtime Package. On the right-hand side click in the selection Link with runtime packages to turn it off.

Compile and test. This will work with the standard Windows programs. I've never used FireMonkey so I can't say if there are other options for that.

Re: Linking all dependencies into a single executable file

PostPosted: Mon Jun 29, 2020 11:21 am
by rlebeau
2ffat wrote:First, make certain that you have changed the compiler from Debug to Release.


That is not a requirement. Debug builds can be made to be self-contained, too.

Re: Linking all dependencies into a single executable file

PostPosted: Mon Jun 29, 2020 11:49 am
by 2ffat
rlebeau wrote:That is not a requirement. Debug builds can be made to be self-contained, too.


I learned something new today.