How to choose QNX target libraries

“Note: This article applies to Connext DDS Professional 4.x and above”

The QNX operating system provides in its SDK a front-end that calls a GCC named “qcc”. In the end, qcc will call the compiler, set the correct flags and link libraries based on the parameters that you use.

The SDK provides the C and C++ runtime. You can choose which C++ library to use by using a specific flag when calling qcc. This article explains what flags are available to pass to gcc and how to choose the correct RTI Connext DDS target library depending on your QNX system.

In short, you will use the -Y flag, appended with a string that matches your desired library, such as -Y_gpp for the GNU C++ library, or -Y_cpp for the Dinkum C++ library.

The choices for what to append to -Y are in the lists below.

QNX SDK 6.x.x:
  • _gpp — GNU C++ lib
  • _cpp — Dinkum C++ lib (default)
  • _cpp-ne — Dinkum C++ lib (no exceptions)
  • _acpp — Dinkum Abridged C++ lib
  • _acpp-ne — Dinkum Abridged C++ lib (no exceptions)
  • _ecpp — Embedded Dinkum C++ lib
  • _ecpp-ne — Embedded Dinkum C++ lib (no exceptions)

For more information, see http://www.qnx.com/developers/docs/6.5.0SP1.update/com.qnx.doc.neutrino_utilities/q/qcc.html.

QNX SDK 7.0.0:

  • _cxx — LLVM C++ library (default) (only C++11 and C++14)
  • _gpp — GNU C++ library

  Notes:

  1. libcpp (the Dinkumware C++ library) has been discontinued. The new default C++ library is libc++ ( _cxx).
  2. The “no-exceptions” variants of the libraries have been removed from both the LLVM and GNU C++ libraries. Now they can be disabled by adding -fno-exceptions to CXXFLAGS.

       For more information, see http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html.

You will use the -Y flag to choose which library you want, appended with the one of the strings from the above lists.

For example, this will use the GNU C++ library:

qcc -Y_gpp -lang-c++ -fexceptions 

To choose the correct RTI Connext DDS target library, pick the one compiled with the same flags that you require for your application.

The library name tells you which flags it was compiled with. For example, there are libraries named  armv8QNX7.0.0qcc_gpp5.4.0 and armv8QNX7.0.0qcc_cxx5.4.0.

Suppose you want to compile with the GNU C++ library. Then you will use the target library with “_gpp” in its name, since you are using the same  _gpp flag for your application. That is, choose the armv8QNX7.0.0qcc_gpp5.4.0 library to link against your application that is using _gpp.

Note: Not all versions of RTI Connext DDS support all the library choices in the above lists.

Platform:
Programming Language: