API (*.lib, *.a)

From RAD Studio
Jump to: navigation, search

Go Up to File Types Index


RAD Studio generates a package static library file:

  • When you build a Delphi package for iOS Device or Android.
  • When you build a Delphi package for a desktop platform and you use the "Generate all C++Builder files (including package libs)" value for the C/C++ Output file generation option in Project > Options > Delphi Compiler > Output - C/C++.
  • When you build a C++ package and you enable the Generate static package library (.lib) option in Project > Options > C++ Linker.

A package static library file is a static library file generated from a package. You use a static library in place of an import library when your application does not use run-time packages. See Building Static Packages.

The file name of your package static library file is:

  • <package>.lib for 32-bit Windows.
  • <package>.a for 64-bit Windows and OS X.
  • lib<package>.a for iOS Device and Android.
    Note: You can not generate a package static library file for iOS Simulator.

When you build your package that meets the requirements, your package static library file is generated by default into the following folder:

  • For 32-bit Windows in Delphi and C++: C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp
  • For other platforms in Delphi: C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\<platform>
  • For other platforms in C++: C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp\<platform>\<build configuration>

To change the output directory:

  • In Delphi, use the C/C++ .obj/.lib output directory option in Project > Options > Delphi Compiler > Output - C/C++. If left blank, the DCP output directory specified in Project > Options > Delphi Compiler is used.
  • In C++, use the BPI/LIB output option in Project > Options > C++ (Shared Options).

See Also