PathEngine home previous: Building for Maximum Speednext: Building the TestBed for Other Platforms
Contents, Programmers Guide, Building the Source Code, Static Linkage

Static Linkage

The full source package enables your application to link directly with the PathEngine runtime as a single static library.

(With the full source package you can build PathEngine with the same compiler and compile and link settings as are being used by the rest of the application, which ensures link compatibility for things like run-time library linkage, calling conventions, and so forth.)

The run-time API is identical when linking against PathEngine statically or as a DLL, except for the the process of initialising the SDK and obtaining the root interface pointer (and eventually shutting things down, if this is desired).


Initialise the SDK with PathEngine_InitialiseAndObtainRootInterface, with this method then supplying the root interface pointer for further API calls.

Explicit shutdown and reinitialisation

If desired, the SDK can be explicitly shutdown, with PathEngine_ShutDown (and also subsequently reinitialised).

Memory instrumentation and static linkage

PathEngine's memory instrumentation uses a very simple technique based on over-riding global new and delete operators, and is designed for use with the DLL build of the SDK.

Example code

An example project for static linkage against the SDK is provided in 'SDKRoot/LinkageExamples/LinkageWithSharedObject' (included with the source archives).

The example project directory includes a Visual Studio project for the PC (Windows-x86) platform, and a python script to build on GCC based platforms.

The Visual Studio project is essentially a vanilla console exe project with the PathEngine interface directory added to the includes path, and the set of PathEngine static libraries added to linker input.
Run the generated exe from a console, or debug through execution, and you should see the line 'Simple test completed successfully.' being output.

The python script uses the same platform config as the main python build scripts, and requires the same environmental variables setup.
(Refer to Building with the Python Build Scripts for details.)
To run the script simple change directory to the example project directory, and type 'python'.
The script simply dispatches the required compile and link commands. If you're not familiar with python that you can nevertheless refer to the output of this script for the command lines used.

Documentation for PathEngine release 6.03 - Copyright © 2002-2021 PathEnginenext: Building the TestBed for Other Platforms