Compiling and Building Multi-Device Applications

From RAD Studio
Jump to: navigation, search

Go Up to Multi-Device Applications Index


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

Prerequisites for Multi-Device Applications

Before building or compiling a multi-device application that targets a platform other than 32-bit Windows, you must configure your multi-device application:

  1. Add the multi-device target and activate that target platform.
  2. If you target 32-bit or 64-bit Windows running on a remote PC other than the development PC, macOS, or iOS, create a connection profile.
    • Where a connection profile is required, the development PC must also be connected to the target machine, on which the Platform Assistant is running.
  3. If you target macOS, iOS (Device), or Android, add an SDK to RAD Studio. See Adding a macOS or iOS SDK or Adding an Android SDK.

For local 32-bit and 64-bit Windows application development, you do not need to do this configuration. However, doing this configuration for remote 32-bit and 64-bit Windows target platforms enables you to use the Platform Assistant (which facilitates debugging) and the Deployment Manager (which facilitates application deployment).

Output Files for Multi-Device 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 applications with target platforms other than Windows typically have the same file names as Win32 files, but have platform-specific file extensions. For example, a static library (.lib on Win32 and Win64) has the .a file extension for macOS and iOS. 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 macOS, packages and (dynamic) libraries have the file extension .dylib (remember that C++ does not currently support macOS). The output directory on the Mac is controlled by the environment variable dylib_path.
  • On the iOS Device - 64 bit platforms packages and (static) libraries have the file extension .a.
  • On the Android platform, packages and (dynamic) libraries have the file extension .so.

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

  Platform      Package      Dynamic Library      Static Library   
32-bit Windows

file.bpl in C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl

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

.dproj in C:\Users\<user>\Documents\Embarcadero\Studio\Projects\projectname

.pas, .dfm in C:\Users\<user>\Documents\Embarcadero\Studio\Projects

.exe, .rsm in

C:\Users\<user>\Documents\Embarcadero\Studio\Projects\projectname\Win32\Debug

file.dll

file.lib

64-bit Windows

file.bpl in C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\Win64

file.dll

file.lib

macOS

bplfile.dylib in C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\OSX32

libfile.dylib

file.a

iOS Device - 64 bit

libfile.a in C:\Users\Public\Documents\Embarcadero\Studio\23.0\Dcp\iOSDevice64

file.a

libFile.a

Android

libfile.a in C:\Users\Public\Documents\Embarcadero\Studio\23.0\Dcp\Android

libFile.so

libFile.a

Linux 64-bit

bplfile.so in C:\Users\Public\Documents\Embarcadero\Studio\23.0\Dcp\Linux64

libFile.so

N/A

Samples for the current release are located at: C:\Users\Public\Documents\Embarcadero\Studio\23.0\Samples. To find the Samples, you can also use Start | Programs | Embarcadero RAD Studio Athens | 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-specific folders. The macOS, iOS and Android files have different file extensions than the Windows versions. But 32-bit Windows and 64-bit Windows 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 Win64 or Android64.

How the Project Manager Treats Multi-Device Files

The Projects Window 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, 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 the iOS 64-bit target platform)
    • .lib (static library for the 32-bit and 64-bit Windows target platforms)
  • Object files:
    • .o (object file for the iOS 64-bit target platform)
    • .obj (object file for the 32-bit and 64-bit Windows target platforms)

The Project Manager enables and disables the files as follows:

State 32-bit Windows 64-bit Windows 64-bit iOS

Enabled

.lib .obj

.a .o

Disabled

.a .o

.lib .obj

See Also