C++ Linker
Go Up to Project Options Dialog Box
Project > Options > C++ Linker
Use this dialog box to set C++ linker options.
Options | Description |
---|---|
Target, Apply, Save |
See Target Options. |
Common items |
Linking Options
Linking options | Description | Linker switches | ||||
---|---|---|---|---|---|---|
ilink32 | ilink64 | xlink | 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 | -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 | -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 | -v | -S | -S |
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 | -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 | 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 | -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 | -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 | -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 | 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 | 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 | N/A |
Specify maximum number of errors |
Sets the specified number of errors encountered (nn) before the link is aborted. |
-Enn | -Enn | -Enn | Platform not supported | Platform not supported |
Advanced Options
Advanced options | Description | Linker switches | ||||
---|---|---|---|---|---|---|
ilink32 | ilink64 | xlink | ld (iOS) | ld (Android) | ||
Additional options |
Enter any additional linker options you want. For options, see ILINK32, the 32-bit Incremental Linker. |
N/A | N/A | N/A | 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 | -c | Platform not supported | Platform not supported |
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 | -C | Platform not supported | Platform not supported |
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 so desired. See the description of the pop-up button in Common Items on Project Options Pages. |
-d | -d | -d | Platform not supported | Platform not supported |
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 | -Gz | Platform not supported | Platform not supported |
Fast TLS |
Allocate TLS (thread-local storage) from Windows instead of using the mechanism to share TLS. |
-Gt | -Gt | -Gt | Platform not supported | Platform not supported |
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 | -Af | Platform not supported | Platform not supported |
Object alignment |
The linker uses the object alignment value to determine the virtual addresses of the various objects and sections (such as code and data) in your application. 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 | -Ao | Platform not supported | Platform not supported |
Replace resources |
Add and/or replace resources without stripping away the existing resources. |
-Rr | -Rr | -Rr | Platform not supported | Platform not supported |
Verbose linking |
Sets the verbose option for RLINK32, and detailed information is emitted during the resource link. |
-r | -r | -r | Platform not supported | Platform not supported |
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 | Platform not supported | -l | -l |
Link with DBX InterBase |
Links with the dbExpress InterBase client library. |
Platform not supported | Platform not supported | Platform not supported | -lsqlib | -lsqlib |
Link with Indy |
Links with the Indy libraries. |
Platform not supported | 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 | Platform not supported | -libtogo | -libtogo |
Link with Midas |
Links with MIDAS, the DataSnap library. |
Platform not supported | 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 | Platform not supported | -lpcre | Platform not supported |
Link with SQLite |
Links with the dbExpress SQLite client library. |
Platform not supported | 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 | Platform not supported | -lssl -lcrypto | Platform not supported |
Link with ZLib |
Links with the ZLib compression library. |
Platform not supported | 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 | 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 | Platform not supported | -exported_symbol | Platform not supported |