From 6:00 PM CST Friday, Feb 15th - 2:00 AM CST Sunday, Feb 17th, will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Table Of Contents

Shared Library Best Practices

    Last Modified: September 26, 2017

    Prepare your shared library to minimize errors when using a Shared Library Interface (SLI).

    When implementing an SLI, ensure the following:
    • Your entry point is exported from the shared library. For example, in a C++ library, declare the functions you want to use with the _declspec (dllexport) keyword in the header file and the source code, or define them in the EXPORTS section of the module definition file.
    • The C++ compiler has not decorated the function name. Name decoration doesn't cause any technical problems, but can make your code less clear to read. Use the C++ compiler function export directive, extern "C"{}, in your header file, as shown in the following example code:
      extern "C" {
      /* your function prototypes here */
    • All applications that use the shared library are unloaded from memory before recompiling the shared library. This ensures the shared library itself is not loaded into memory when recompiling. For example, if you are using a shared library in your VI, you must close the entire project before recompiling your shared library.

    For troubleshooting specific errors with your shared library, use the debugger of your compiler to set breakpoints, step through code, or watch the values of variables. Refer to your compiler's manual for more information about debugging.

    Recently Viewed Topics