cgccqnxqnx-neutrinomomentics

How do I use different compilation standards in QNX Momentics 6.5?


I'm trying to build applications for the Sabre i.MX6 development board, that runs QNX OS. I'm using QNX Momentics v6.5 for cross-compiling my code. I wrote a simple "Hello World" code and I'm trying to compile it with new c standards since the project I'm working on requires that.

When I try to compile with any flag, say -std=c99 or -std=c11, it throws an error during the compilation saying

cc: unknown Option -std=c99" or "cc: unknown Option -std=c11".

I can see that the compiler it's using is gcc 4.4.2.

I'm not sure whether this version of gcc doesn't support c99 or whether the flag I'm passing is supposed to be different for QNX Momentics.


Solution

  • QNX 6.5 and gcc 4.4.2 don't support C++11. See the QCC docs for more info. The best you'll get is incomplete and experimental support through -std=c++0x or -std=gun++0x.

    QNX 6.6 includes gcc 4.7.3 which does have experimental C++11 support and QNX 7.0 uses gcc 5.4.0 has full C++11 and C++14 support.

    Full details of the gcc C++ standards support can be found on the gcc standards page.