Show: Delphi C++
Display Preferences

Compiling and Building Multi-Device Applications

From RAD Studio
Revision as of 22:09, 2 September 2011 by KrisHouser (Talk | contribs)

Jump to: navigation, search

Go Up to Cross-Platform Applications Index


In general, you build and compile your cross-platform application in the IDE the same way you build and compile a native Win32 application in RAD Studio.

Contents

Prerequisites for Cross-Platform Applications

  • Before building or compiling a cross-platform application that targets either Mac OS X or a remote Win64 system, you must configure your cross-platform application (that is, add the cross-platform target, activate the target platform, and create a remote profile). The development PC must also be connected to the target platform, on which the Platform Assistant is running.
  • For local Win32 or Win64 application development, you do not need to do this configuration. However, doing this configuration for remote Win32 and Win64 target platforms enables you to use the Platform Assistant (which facilitates debugging) and the Deployment Manager (which facilitates application deployment).
    For instructions and details, see:

Output Files for Cross-Platform Targets

Output files for Win64 applications have the same names as output files for Win32 applications. However, the Win64 files are output to a different directory than the Win32 files.

Output files for Mac OS X applications typically have the same file names as Win32 files, but have Mac-specific file extensions. For example, a static library (.lib on Win32 and Win64) has the .a file extension on the Mac. See also File Extensions of Files Generated by RAD Studio.

Packages and Shared Libraries

Delphi and C++Builder produce libraries that are targeted for the specific target platform:

  • On 32-bit and 64-bit Windows, packages and libraries have the file extension .bpl and .dll files, respectively.
  • On Mac OS X, packages and libraries have the file extension .dylib. The output directory on the Mac is controlled by the environment variable dylib_path.

The naming convention used by the IDE is summarized in the following table:

  Output File    On 32-bit Windows (Native) Platform On 64-bit Platform On Mac OS X Platform

Package

file.bpl in C:\Users\Public\Documents\RAD Studio\9.0\Bpl

You can set the Package output directory option in the Delphi Compiler page of Project Options.

.dproj in C:\Users\name\Documents\RAD Studio\Projects\projectname

.pas, .dfm in C:\Users\name\Documents\RAD Studio\Projects

.exe, .rsm in C:\Users\name\Documents\RAD Studio\Projects\projectname\Win32\Debug

file.bpl

bplfile.dylib in C:\Users\name\Documents\RAD Studio\Projects\projectname\Win32\Debug

Dynamic Libraries

file.dll

file.dll

libfile.dylib


Samples for XE2 are located at: C:\Users\Public\Documents\RAD Studio\9.0\Samples. But to find the Samples, you can also use Start | Embarcadero RAD Studio XE2 | Samples.

32-bit Design-Time Packages Are Required for 64-bit Windows Applications

The IDE is a native 32-bit Windows application. Therefore, in order to use the IDE to design a 64-bit Windows application, you must have 32-bit Windows versions of all the design-time components, packages, and libraries. You need 32-bit versions of these in order to use the components, packages, or libraries in the IDE at design time. If your application uses a specific component, package, or library at run time only, you do not need to have the 32-bit version in your project.

The IDE typically saves packages and libraries in platform-specfic folders. The OS X files have different file extensions than the Windows versions (.dylib on the Mac vs. .dll or .lib on Windows). But Win32 and Win64 versions of packages, libraries, and components created by the RAD Studio IDE have the same file names and extensions; only the paths are different. When you save a component, a package, or a library, the output file is placed in a platform-specific directory, such as Win32, Win64, or OS X.

How the Project Manager Treats Cross-Platform Files

The Project Manager enables the correct platform-specific file types for your project, as determined by the currently active target platform. At the same time, the Project Manager disables the file types associated with any inactive target platforms in the current project.

For example, when the target platform is Win32 (the default), commands in the Project Manager (such as Build, Compile, Clean) produce Win32 files, such as .LIB and .OBJ.

As a further example, suppose that your multiplatform C++ project contains the following types of files:

  • Static libraries:
    • .a (static library for OS X and Linux target platform)
    • .lib (static library for Win32 or Win64 target platform)
  • Object files:
    • .o (object file for OS X and Linux target platform)
    • .obj (object file for Win32 or Win64 target platform)

The Project Manager enables and disables the files as follows:

   Win32 or Win64 Target       Mac OS X Target   

Enabled:
.lib
.obj

Enabled:
.a
.o

Disabled:
.a
.o

Disabled:
.lib
.obj


See Also

Personal tools
In other languages