C++ Linker
Go Up to Building
Project > Options > Building > C++ Linker
Use this dialog box to set C++ linker options.
Contents
Options | Description |
---|---|
Target, Apply, Save |
See Target Options. |
Common items |
Linking Options
Linking options | Description | Linker switches | ||||
---|---|---|---|---|---|---|
ilink32 | ilink64 | ld (iOS) | ld (Android) | |||
Disable incremental link |
Suppresses the generation of linker state files, disabling incremental linking. If you use the Disable incremental link option, subsequent links take just as long as the first one. |
-Gn | -Gn | Platform not supported | Platform not supported | |
Display time spent on link |
Include in the linker output the amount of time required to complete the linking. |
-t | -t | Platform not supported | Platform not supported | |
Full debug information |
Includes information in the output file needed to debug your application with the C++Builder integrated debugger: On the command line, this option causes the linker to include debugging information in the TDS file for all object modules that contain debugging information. You can use the -v+ and -v- options to selectively enable or disable debugging information on a module-by-module basis (but not on the same command line where you use -v). For example, the following command includes debugging information for modules
Default = False
|
-v | -v | -S | -S | |
Garbage collect unused sections |
Reduces final binary size by removing functions and data present in the object files but never used in the final binary. |
Platform not supported |
Platform not supported |
Platform not supported | ||
Generate .drc file |
ILINK32 generates Delphi-compatible .RC files (.drc files). The .drc file has the same name as the executable file and is emitted to the same directory as the executable file. |
-GD | -GD | Platform not supported | Platform not supported | |
Generate .map symbols file |
Generates a mapfile in .\OutputFolder\ProjectName.map. For desktop platforms, you set the Map file options on the C++ Linker Output page. |
N/A | N/A | -map (not enabled) | -Map (not enabled) | |
Generate import library |
Generates an import library file, a small static library that describes the exports of either a package or a .dll so that an application can link against it. This file is used when linking dynamic libraries. Without an import library, you cannot use the package in C++. The import library file extension is:
Enabled only for C++ packages. |
-Gi | -Gi | Platform not supported | Platform not supported | |
Generate static package library (.lib) |
Generates a statically linkable package library. Building a C++ static package library (.lib) requires a set of .objs that are different from the .objs used to build the dynamic library (.bpl). When this option is enabled (the default setting), a build or make command produces two sets of .objs:
The .obj files for the static library (.lib) are output into a subdirectory created in your project directory, typically the When this option is disabled, a build or make command produces only the dynamic library (.bpl). For more information, see Building Static Packages. Enabled only for C++ packages. Default = True |
-Gl | -Gl | Platform not supported | Platform not supported | |
Keep output files |
Tells the linker to keep output files that would otherwise be deleted on errors. The linker has been changed to delete its output file (EXE/DLL) if there are errors in the link. The old behavior was to leave these files and not delete them. |
-Gk | -Gk | Platform not supported | Platform not supported | |
Link with Dynamic RTL |
Controls whether the C RTL links dynamically (or statically) with run-time library (cc3290.dll). |
N/A | N/A | N/A | N/A | |
Link with the Delphi Runtime Library |
Ensures that the application is linked with the following:
C++ links with the Delphi RTL if this option is enabled, or if the project has a framework affinity. For example, FMX Forms projects, by virtue of their framework affinity, link with the Delphi RTL. Use this option for any C++ application that has no framework affinity and that you want to use some Delphi types (such as UnicodeString, Variant, and so on) or access some functionality exposed by units in the Delphi RTL package (such as SysUtils, Classes, IOUtils, and so on). C++ console applications cannot handle Delphi exceptions unless you either enable this option or select a framework when you create the application using the New Console Application (C++) wizard. |
N/A | N/A | N/A | N/A | |
Remove the temporary .lnk linker file after linking |
This option removes the temporary linker file in .\OutputFolder\ProjectName.lnk. |
N/A | N/A | N/A | N/A | |
Specify maximum number of errors |
Sets the specified number of errors encountered (nn) before the link is aborted. |
-Enn | -Enn | Platform not supported | Platform not supported |
Advanced Options
Advanced options | Description | Linker switches | |
---|---|---|---|
ilink32 | ilink64 | ||
Additional options |
Enter any additional linker options you want. For options, see ILINK32, the 32-bit Incremental Linker. |
N/A | N/A |
Case sensitive linking |
The linker differentiates between upper and lowercase characters in public and external symbols. Normally, this option should be set, since C and C++ are both case-sensitive languages. |
-c | -c |
Clear state before linking |
Deletes the existing incremental linker state files and then recreates these files and continues with the link. This option allows you to refresh the state files. |
-C | -C |
Data Execution Prevention compatible |
Specifies whether the executable image is compatible with Windows Data Execution Prevention. |
-GE:NXCOMPAT=ON -GE:NXCOMPAT=OFF | -GE:NXCOMPAT=ON -GE:NXCOMPAT=OFF |
Delay load .DLLs |
Specifies DLLs that are to be delay loaded. Delayed loading of DLLs is useful for DLLs that are used very infrequently by an application but might have high startup costs. DLLs that have been delay loaded are not loaded and initialized until an entry point in the DLL is actually called. There is accompanying RTL support for delayed load DLLs that the user can hook into to handle errors on loading and to supplant the delayed load system if desired. See the description of the pop-up button in Common Items on Project Options Pages. |
-d | -d |
Do image checksum |
Calculates the checksum of the target and places the result in the target PE header. This is used for NT Kernel mode drivers and system DLLs. |
-Gz | -Gz |
Enable Large Addresses |
Specifies whether the object supports addresses that are larger than two gigabytes. |
-GF:LARGEADDRESSAWARE | |
Fast TLS |
Allocate TLS (thread-local storage) from Windows instead of using the mechanism to share TLS. |
-Gt | -Gt |
File alignment |
Specifies page alignment for code and data within the executable file. The linker uses the file alignment value when it writes the various objects and sections (such as code and data) to the file. For example, if you use the default value of 0x200, the linker stores the section of the image on 512-byte boundaries within the executable file. When using this option, you must specify a file alignment value that is a power of 2, with the smallest value being 16. The old style of this option ( The command-line version of this option ( |
-Af | -Af |
Object alignment |
The linker uses the object alignment value to determine the virtual addresses of your application's various objects and sections (such as code and data). For example, if you specify an object alignment value of 8192, the linker aligns the virtual addresses of the sections in the image on 8192-byte (0x2000) boundaries. When using this option, you must specify an object alignment value that is a power of 2, with the smallest value being 4096 (0x1000), the default. The command-line version of this option ( |
-Ao | -Ao |
Replace resources |
Add and/or replace resources without stripping away the existing resources. |
-Rr | -Rr |
Support address space layout randomization (ASLR) |
Specifies whether the DLL or executable image can be randomly rebased at load-time by using address space layout randomization (ASLR). |
-GE:DYNAMICBASE=ON -GE:DYNAMICBASE=OFF | -GE:DYNAMICBASE=ON -GE:DYNAMICBASE=OFF |
Support high-entropy 64-bit address space layout randomization (ASLR 64-bit) |
Specifies whether the DLL or executable image supports high entropy (64-bit) address space layout randomization (ASLR). Note: This flag is only available in Win64.
|
-GE:HIGHENTROPYVA=ON -GE:HIGHENTROPYVA=OFF | |
Terminal Server |
Specifies that the app is designed to run in a multi-user environment. |
-GE:TSAWARE=ON -GE:TSAWARE=OFF | -GE:TSAWARE=ON -GE:TSAWARE=OFF |
Verbose linking |
Sets the verbose option for RLINK32, and detailed information is emitted during the resource link. |
-r | -r |
Additional linked libraries
Additional Library | Description | Linker switches | ||||
---|---|---|---|---|---|---|
ilink32 | ilink64 | ld (iOS) | ld (Android) | |||
Additional options Additionally linked libraries |
Links your application against the specified list of libraries. Specify libraries by codename. For example, to link with MIDAS, add "midas" to the list.
|
Platform not supported | Platform not supported | -l | -l | |
Link with DBX InterBase |
Links with the dbExpress InterBase client library. |
Platform not supported | Platform not supported | -lsqlib | -lsqlib | |
Link with Indy |
Links with the Indy libraries. |
Platform not supported | Platform not supported | -lIndyCore -lIndyProtocols -lIndySystem | -lIndyCore -lIndyProtocols -lIndySystem | |
Link with Interbase ToGo |
Links with the dbExpress InterBase ToGo client library. |
Platform not supported | Platform not supported | -libtogo | -libtogo | |
Link with Midas |
Links with MIDAS, the DataSnap library. |
Platform not supported | Platform not supported | -lmidas | -lmidas | |
Link with Regular Expressions. |
Links with the regular expressions library, the PCRE (Perl-compatible regular expressions) library adapted to C++. |
Platform not supported | Platform not supported | -lpcre | Platform not supported | |
Link with SQLite |
Links with the dbExpress SQLite client library. |
Platform not supported | Platform not supported | -lsqlite3 | -lsqlite | |
Link with SSL and Crypto |
Links with the OpenSSL libraries. See for example Creating an iOS App, OpenSSL Support. |
Platform not supported | Platform not supported | -lssl -lcrypto | Platform not supported | |
Link with ZLib |
Links with the ZLib compression library. |
Platform not supported | Platform not supported | -lz | -lz | |
Minimum iOS version supported. |
Defines the minimum iOS version that your application supports. See FireMonkey Platform Prerequisites, iOS Requirements. |
Platform not supported | Platform not supported | -iphoneos_version_min | N/A | |
Symbols that our runtime expects to be exported |
List of symbols that must be exported because they are required at run time. |
Platform not supported | Platform not supported | -exported_symbol | Platform not supported |
Linker Heap Settings
WIN64
Linker Heap Settings | Description | Command Line Flag |
---|---|---|
Code Heap Size |
Heap for |
-GHcode=0xnnnn |
Data Heap Size |
Heap for |
-GHdata=0xnnnn |
Dwarf abbrev Heap Size |
Heap for abbreviation codes |
-GHdwarf_abbrev=0xnnnn |
Dwarf aranges Heap Size |
Heap for address range entries |
-GHdwarf_aranges=0xnnnn |
Dwarf info Heap Size |
Heap for modules and types of trivial symbols |
-GHdwarf_info=0xnnnn |
Dwarf line Heap Size |
Heap for line number information |
-GHdwarf_line=0xnnnn |
Dwarf loc Heap Size |
Heap for location descriptions |
-GHdwarf_loc=0xnnnn |
Dwarf macinfo Heap Size |
Heap for macro information |
-GHdwarf_macinfo=0xnnnn |
Dwarf pubtypes Heap Size |
Heap for types of public symbols |
-GHdwarf_pubtypes=0xnnnn |
Dwarf ranges Heap Size |
Heap for address ranges |
-GHdwarf_ranges=0xnnnn |
Dwarf str Heap Size |
Heap for Dwarf strings |
-GHdwarf_str=0xnnnn |
WIN32
Linker Heap Settings | Description | Command Line Flag |
---|---|---|
Info Heap Size |
Heap for linker data structures |
-GHinfo |
Code Heap Size |
Heap for code |
-GHcode |
Data Heap Size |
Heap for data |
-GHdata |
RO Data Heap Size |
Heap for read-only data |
-GHrodata |
Uninitialized data Heap Size |
Heap for uninitialized data |
-GHbss |
TDS Heap Size |
Heap for Turbo Debugger symbols |
-GHtds |