Building Applications

Static Linking - Choosing HWI at Build-time

The simplest way for an application to use the LayGO Hardware Interface is to statically link to the appropriate LayGO library. The LayGO API functions exported are identical. Only the implementation is different. The correspondence of standard and Hardware Interface libraries is shown below:

Operating System Standard API Hardware Interface
Win32 laygo32a.lib
laygo32d.lib
laygo32m.lib
laygo32h.lib
laygo32g.lib
laygo32m.lib
Solaris liblaygoa.so
liblaygod.so
liblaygom.so
liblaygoh.so
liblaygog.so
liblaygom.so
Linux liblaygolnxa.so
liblaygolnxd.so
liblaygolnxm.so
liblaygolnxh.so
liblaygolnxg.so
liblaygolnxm.so

Note that a special version of the LayGO Device Library is required (one linked against the Hardware Interface version of the API), but the LayGO message library is the same for both standard and hardware interface versions.

Dynamic Linking - Choosing HWI at Run-time

As an alternative to static linking, the LayGO Toolkit supports type-safe dynamic loading of the LayGO libraries via the LayGO Dynamic Loading API. Both the standard and Hardware Interface versions of the LayGO API can be loaded in this way with the choice made at runtime. This means that an application can be written to use either the standard API or the Hardware Interface API. LayGO for Java uses this method to support both the standard API and the Hardware Interface version in a single JNI implementation. See the LayGO Dynamic Loading API for details.