Adding PLUSNative to your application

PLUSNative is a pure standard C library that should be compatible with most modern C/C++ compilers and integrated development environments (IDEs) capable of using shared (DLL) or static C libraries. Refer to the particular documentation for your toolset to determine if they support C libraries and how to call them.

Header Files

The SoftwareKey/PLUSNative/inc directory contains the 'include' files (header files and library definition files). These contains all of the function prototypes and constants that make up the PLUSNative API.

PLUSNative.h
C/C++ header file.
PLUSNative.bas
VB6 library definition file.
PLUSNative.pas
Delphi 7+ (Pascal) library definition file.

Library Files

The SoftwareKey/PLUSNative/lib directory contains all the PLUSNative library files. 32-bit library files are located in the x86 subdirectory, while 64-bit library files are located in the x64 subdirectory. Library files for a given platform are found in their respective folders. This includes the linux, macOS and windows subdirectories. Within each of these directories you will find the shared-dll, static and static-nodeps directories. The shared-dll directory contains the shared or dynamic-link libraries, while the static directory contains the static libraries (or archives). The static-nodeps directory contains static libraries that do not bundle the third-party libraries used by PLUSNative. Refer to the Third-Party Dependencies section below for details on when and how to use these libraries.

The following provides a description of the various library files provided:

Linux

libPLUSNative.a
The PLUSNative static library.
libPLUSNative.so
The PLUSNative shared library.

macOS and iOS

libPLUSNative.a
The PLUSNative static library.
libPLUSNative.dylib
The PLUSNative shared library.

Windows

PLUSNative.dll
The PLUSNative dynamic-link library.
PLUSNative_dllimport.lib
The PLUSNative dynamic-link import library. Link with this to early-bind to PLUSNative.dll.
PLUSNative.lib
The PLUSNative static library. Uses static C Runtime for projects compiled with /MT.
PLUSNative_md.lib
The PLUSNative static library. Uses dynamic C Runtime for projects compiled with /MD.

Third-party Dependencies

PLUSNative uses several third-party open source libraries as it's core. This includes libcurl, libxml2 and OpenSSL (libcrypto and libssl). Refer to the Third-Party Licenses topic for details on the permissive open source licenses used by these libraries. These libraries are linked into the shared dynamic-link libraries and do not need to be distributed separately. The static libraries also include these third-party libraries. If you happen to use any of these third-party libraries in your own application and intend to use the PLUSNative static library you should use the libraries provided in the static-nodeps directory, as these do not include these third-party libraries. If you use one or more of these third-party libraries, but not all of them, you will need to start linking all of them or consider using the PLUSNative shared dynamic-link library instead.

Other System Library Dependencies

The following system libraries are dependencies that must be linked into your application when linking the PLUSNative static libraries.

Linux

libm
The standard math library.

OS X

CoreFoundation
The CoreFoundation framework.
CoreServices
The CoreServices framework.
DiskArbitration
The Disk Arbitration framework.
IOKit
The IOKit framework.
Security
The Security framework.

Windows

Crypt32.lib
The Windows Cryptography (CrpytoAPI) library.
Ws2_32.lib
The Windows Sockets 2 (Winsock) library.

Universal Libraries for macOS

OS X supports universal (or fat) binaries that combines objects for multiple architectures in a single binary executable or library file. PLUSNative includes a universal library that supports x86, x64, and Apple Silicon platforms.

If all three of the platforms do not need to be supported, then any combination of the libraries may be combined into a single universal binary using the OS X lipo command.

The following example demonstrates combining the 32-bit and 64-bit static libraries into a universal library. These commands would be issued in the OS X Terminal or executed from a bash script.

bash

cd ~/SoftwareKey/PLUSNative/lib
mkdir universal
lipo ./x86/macOS/static/libPLUSNative.a ./x64/macOS/static/libPLUSNative.a -create -output ./universal/libPLUSNative.a