RAD Studio (Common)
ContentsIndex
PreviousUpNext
C++ Compiler C++ Compilation

ProjectOptionsC++ CompilerC++ Compilation 

Use this dialog box to set C++ Compiler options.

Build Configuration options 
Description 
Build Configuration 
Displays the active build configuration. Use the drop-down menu to select another build configuration.  
Save As... 
Displays the Save As dialog box to save the current configuration's options to a file that can be loaded as a named option set.  
Load... 
Displays the Apply Option Set dialog box to apply the options in a named option set to the current configuration.  

 

C++ options 
Description 
Template generation 
Default (-Jgd)*
The compiler generates public (global) definitions for all template instances. If more than one module generates the same template instance, the linker automatically merges duplicates to produce a single copy of the instance.
To generate the instances, the compiler must have available the function body (in the case of a template function) or the bodies of member functions and definitions for static data members (in the case of a template class), typically in a header file.
This is a convenient way of generating template instances.
This is the default.
External (-Jgx)
The compiler generates external references to all template instances.
If you use this option, all template instances that need to be linked must have an explicit instantiation directive in at least one other module.  
Virtual tables 
Smart (-V)*
Generates common C++ virtual tables and out-of-line inline functions across the modules in your application. As a result, only one instance of a given virtual table or out-of-line inline function is included in the program.
The Smart option generates the smallest and most efficient executables, but produces .OBJ and .ASM files compatible only with CodeGear linkers and assemblers.
This is the default.
External (-V0)
Generate external references to virtual tables. If you don’t want to use the Smart option, use the External and Public options to produce and reference global virtual tables.
When you use this option, one or more of the modules comprising the program must be compiled with the Public option to supply the definitions for the virtual tables.
Public (-V1)
Public produces public definitions for virtual tables. When using the External option (-V0), at least one of the modules in the program must be compiled with the Public option to supply the definitions for the virtual tables. All other modules should be compiled with the External option to refer to that Public copy of the virtual tables.  
Member pointers 
Smallest possible (-Vmd)
Member pointers use the smallest possible representation that allows them to point to all members of their particular class. If the class is not fully defined at the point where the member pointer type is declared, the most general representation is chosen by the compiler and a warning is issued.
This is the default.
Multiple inheritance (-Vmm)
Member pointers can point to members of multiple inheritance classes (with the exception of virtual base classes).
Single inheritance (-Vms)
Member pointers can point only to members of base classes that use single inheritance.
Default *
No options set for member pointers. This is the default.  
Honor member precision (-Vmp) 
The compiler uses the declared precision for member pointer types. Use this option when a pointer to a derived class is explicitly cast as a pointer-to-member of a simpler base class (when the pointer is actually pointing to a derived class member). Default = false  

 

Exception handling options 
Description 
Enable RTTI (-RT) 
Causes the compiler to generate code that allows runtime type identification (RTTI).
In general, if you set Enable Destructor Cleanup (-xd), you need to set this option as well.
Default = true  
Enable exceptions (-x) 
Sets C++ exception handling. If this option is disabled (-x-) and you attempt to use exception handling routines in your code, the compiler generates error messages during compilation.
Disabling this option makes it easier for you to remove exception handling information from programs; this might be useful if you are porting your code to other platforms or compilers.
Disabling this option turns off only the compilation of exception handling code; your application can still include exception code if you link object and library files that were built with exceptions enabled (such as the CodeGear runtime libraries).
Default = true  
Destructor cleanup (-xd) 
When this option is set and an exception is thrown, destructors are called for all automatically declared objects between the scope of the catch and throw statements.
In general, when you set this option, you should also set Enable Runtime Type Information (-RT) as well.
Destructors are not automatically called for dynamic objects allocated with new, and dynamic objects are not automatically freed.
Default = true  
No DLL/MT destructor cleanup (-xds) 
Does not perform DLL or multi-threaded destructor cleanups. Default = false  
Fast exception prologs (-xf) 
Expands inline code for every exception handling function. This option improves performance at the cost of larger executable file sizes. Default = false  
Location information (-xp) 
When this option is set, runtime identification of exceptions is available, because the compiler provides the file name and source code line number where the exception occurred. This enables the program to use the __ThrowFileName global to obtain the file where the exception occurred and the __ThrowLineNumber global to access the line number from where the C++ exception was thrown. Default = false  
Slow exception epilogues (-xs) 
When this option is set, the exception handling epilogue code is not expanded inline. This option decreases performance slightly. Default = false  
Hide exception variables (-xv) 
The compiler treats the following exception handling symbols as special:
__exception_info
__exception_code
__abnormal_termination
These are all mapped to special compiler/RTL constructs for Structured Exception Handling (SEH) code. If you are not using SEH and you have variables of this name, it means that you could not reference those variables, and your code would not compile. -xv causes the compiler to hide its special symbols in this event, so that you can use variables of this name.
Default = false  
Global destructor count (-xdg) 
Use global destructor count (for compatibility with older versions of the compiler). Default = false  

 

General option 
Description 
Default 
Saves the current settings as the default for each new project.  
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!