Skip to content

Static Embedding

Erik McClure edited this page May 26, 2019 · 1 revision

Statically embedding inNative is the suggested method for most applications that want to load WebAssembly modules. While it is platform-dependent, all platforms must:

  1. Download or Install the SDK.
  2. Link to the inNative static library
  3. Add the include/innative header files to the project
  4. Include the inNative Default Environment static library

Static libraries cannot include other static libraries, so you need to include innative.lib in the root executable or DLL that you are building. Because you are statically embedding the library, you get access to all of the Static Functions listed in the External API.

Windows

Static Library: innative.lib and innative-d.lib

Default Environment: innative-env.lib and innative-env-d.lib

Add the static library to your project's Additional Dependencies (for Visual Studio) or your build system's equivalent. Place the Default Environment libraries inside your /bin/ folder, and ensure you distribute them with your application.

Linux

Static Library: innative.a and innative-d.a

Default Environment: innative-env.a and innative-env-d.a

Add the static library to your linker invocation, next to the .o files, without using the -l option (which is intended for shared libraries). Place the default environment libraries in your /bin/ folder, or wherever your application will live, and ensure you distribute them with your application.