Main Content

Troubleshoot Model Links to Static Libraries or Shared Objects

Some model build and runtime issues occur when I link my real-time application to static libraries (.a) or shared objects (.so).

What This Issue Means

When building or running real-time a application that links to static link libraries (.a) or shared object libraries (.so), there are some considerations that help you use libraries that are compatible with the QNX® Neutrino® RTOS on the target computer. These recommendations are helpful when troubleshooting library usage, including:

  • A link to a library from QNX Neutrino RTOS that is available in the Simulink Real-Time target support package

  • A shared object that is included in the model through an FMU block

  • A custom static library or shared object that is linked to the real-time application

Try This Workaround

These workarounds explore the possible issues.

Link to Accessible Libraries or Objects

When you link to a static library or shared object, the library or object must be:

  • Compatible with the QNX Neutrino RTOS

  • Accessible to the toolchain at build time

Check to ensure that you have followed the guidelines for library compatibility. See External Code Integration of Libraries and C/C++ Code with Simulink Real-Time Models. Check that the toolchain can access the library at build time. Remember that the QNX Neutrino cannot process spaces in the path to files.

Install Shared Objects on Target Computer

After you build the real-time application that links to a shared object, install both the real-time application and the shared object on the target computer. Copy the shared objects to a location on the target computer where they can be found and loaded at runtime. The recommended locations are /lib, /usr/lib, or /usr/local/lib. Root access is required to copy files to these locations.

Rebuild Real-Time Application When Rebuilding Static Libraries

Because linked static libraries are included in the real-time application, when you modify and rebuild a static library, you rebuild any real-time applications that include that library. After rebuilding the static library and the real-time application, reinstall the real-time application on the target computer.

See Also

Related Topics

External Websites