Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the effect of changing the "Dynamic RTL" setting for a static library?

In Embarcadero RAD Studio 2010, there is a setting in the Project Options for for static libraries called "Dynamic RTL". (It's in the TLib section.)

I was under the impression that the decision about whether to link the RTL dynamically or statically is made at link-time, not at compile-time. But the static libs only compile; there is no link step. So, how does changing this option effect my static lib?

I have some .exe and .dll projects that use these static libs and I set the "Dynamic RTL" option in those projects. This makes sense because they actually have something to link, but I don't understand what effect this setting has on static libs.

Could it cause any problems if the static libs have Dynamic RTL = true while the DLLs and EXEs that use this libs have Dynamic RTL = false?

like image 579
Jeff Wilhite Avatar asked Aug 28 '12 15:08

Jeff Wilhite


1 Answers

I don´t use Embarcadero, but an older version of C++ Builder. I think they work the same way. When you use Dynamic RTL your code will call RTL functions from the runtime DLL´s that should shipped with your program. When you don´t use dynamic RTL, the functions are copied from libs into your exe or lib files. I use the dynamic RTL reduce the size of EXE files. The logic is the same for exe or libs. That means that if you use dynamic RTL in any module, be an exe or a lib, you will have to ship also the appropriate runtime DLL´s.

like image 64
Valdeci Avatar answered Nov 15 '22 18:11

Valdeci