Libraries come in three flavors: .dll (dynamic linkable library) for Windows, .so (shared object), and .a—.a and .so are typically found on Unix type systems (including macOS).
Our library is very simple; it acts as a calculation library—you pass in the values to the correct function and the result is returned. Not rocket science but enough to prove what we're going to do.
When using external libraries, we will need to use the unsafe directive. Rust cannot control what an external library delivers and therefore if we used standard code, the compiler will not allow compilation.
As developers, using external libraries must be handled with care.
As developers, using external libraries must be handled with care.