Previous: Optimization, Up: Features


3.11 Shared vs Static

By default, in both optimized and unoptimized mode, stand alone binaries created by Roadsend PHP are dynamically linked. Dynamically linked programs save disk space and memory by sharing the same libraries with other programs.

However, dynamically linked programs are hard to distribute because they depend on many system libraries. On Linux, these might be different from computer to computer. On Windows, they will be additional DLLs that need to be distributed with your application. To solve this problem, you can use static linking.

Static linking can be enabled with the --static commandline switch, or in the project properties dialog in the IDE. When a program is linked statically, the parts of libraries that it depends on are incorporated into the program itself. That way, the program is no longer dependent on any external libraries and is therefore easier to distribute.