--framework

From RAD Studio
Jump to: navigation, search

Go Up to BCCOSX.EXE, the C++ Compiler for OS X


A framework on the Mac is a directory hierarchy that contains headers, dylibs, and resources.

Available OS X Frameworks

The frameworks that can be used are in the /System/Library/Frameworks directory.

Examples of frameworks:

  • Carbon
  • CoreFoundation
  • CoreServices
  • ApplicationServices

Delphi RTL uses the CoreFoundation and CoreServices frameworks.

Command-Line Options for Frameworks

Three command-line options (for BCCOSX and XLINK) pertain to frameworks: --framework, -Ff, and -F.

--framework Option for BCCOSX.EXE, the C++ Compiler for OS X

The --framework option in a BCCOSX command specifies the list of OS X frameworks you want to link to, such as:

--framework=Carbon --framework=CoreFoundation

BCCOSX does not use this option directly—rather the compiler passes the option to the linker. The --framework switch instructs the compiler to tell the linker (XLINK) to link with the dynamic shared library of the specified framework.

--Ff Option for XLINK.EXE, the OS X Linker

A --framework option in a BCCOSX command is turned into an -Ff option when the compiler invokes the linker. If you are calling the linker directly, then use the -Ff option instead of the --framework compiler option. For example, to use the CoreFoundation framework, specify the following option to the linker:

-FfCoreFoundation

The linker searches for the specified frameworks in the remote library paths (paths specified with the -Fp option).

-F Option for BCCOSX.EXE, the C++ Compiler for OS X

The -F option adds a specified directory to the framework header search path. For example:

-F/System/Library/Frameworks;/Library/Frameworks

If --sysroot is specified, paths that start with '/' will have the value of --sysroot prepended.

IDE Support

Frameworks specified by default in a C++Builder console application

To specify the OS X frameworks that are to be used in a RAD Studio project, you need to edit the SDK associated with your application.

To associate an SDK to your application, right-click on a node under the Target Platforms in the Project Manager, and select Properties to open the Platform Properties dialog box. Use that dialog to select the SDK you want to associate to the selected platform.

You can manage your SDKs from Tools > Options > Environment Options > SDK Manager.

Code Examples

See Also