Am I able to use C++11 in QNX?

Laura picture Laura · Dec 9, 2015 · Viewed 8.6k times · Source

I have some cross-platform code with some C++11 features like #include <thread> and others. I will soon be using a QNX 6.6 board, and I'm wondering if my code can compile on it, and which features will be available.

QCC is the official QNX C++ compiler, but I can't find any documentation citing which C++11 features, or even which C++ features in general, it supports. Is this a wrapper around GCC or its own thing? Either way, can I get or compile other compilers on this platform?

Answer

Marged picture Marged · Dec 9, 2015

From what I know qcc is just using gcc internally. Because of this you can use all functionalities provided by the version of gcc that QNX decided to put into their package.

Judging from the release notes of QNX 6.6 gcc 4.7 is used:

  • GCC 4.7 tool chain, including support for the Intel Advanced Vector Extensions (AVX)
  • GDB 7.5
  • New: Binutils 2.24
  • Python 2.7.5, as a host-side tool

The release notes provide a link to information about gcc 4.7 but I think this link better shows which specific features are supported. There is too much information on the linked page, because of that I do not copy it. But in essence the link states:

GCC provides experimental support for the 2011 ISO C++ standard. This support can be enabled with the -std=c++11 or -std=gnu++11 compiler option ... GCC's C++11 mode implements much of the C++11 standard produced by the ISO C++ committee