Linking all dependencies into a single executable file

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Linking all dependencies into a single executable file

Postby smd » Sun Jun 28, 2020 3:50 pm

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?
-----------------------------
Scott
smd
BCBJ Guru
BCBJ Guru
 
Posts: 138
Joined: Sat Nov 29, 2014 8:02 pm
Location: Las Vegas

Re: Linking all dependencies into a single executable file

Postby 2ffat » Mon Jun 29, 2020 5:03 am

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.
James P. Cottingham

Look at me still talking
when there is science to do.
User avatar
2ffat
Forum Mod
Forum Mod
 
Posts: 448
Joined: Wed Jun 23, 2004 7:07 am
Location: South Hill, VA

Re: Linking all dependencies into a single executable file

Postby rlebeau » Mon Jun 29, 2020 11:21 am

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.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1683
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: Linking all dependencies into a single executable file

Postby 2ffat » Mon Jun 29, 2020 11:49 am

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


I learned something new today.
James P. Cottingham

Look at me still talking
when there is science to do.
User avatar
2ffat
Forum Mod
Forum Mod
 
Posts: 448
Joined: Wed Jun 23, 2004 7:07 am
Location: South Hill, VA


Return to Technical

Who is online

Users browsing this forum: No registered users and 24 guests