07-01-2012 05:47 AM
I have been itching to use some of the C++11 features for quite some time now, and I was glad to find out that QNX SDK uses gcc 4.6.3, which supports some of its features including "auto". However compiling cascades app with it failed, because it's not on by default. I tried adding -std=c++11 flag to the .pro file, but that didn't work, because it uses qcc driver instead of gcc and it doesn't seem to have this feature. Is there a flag to switch it on?
07-04-2012 02:00 PM
Try -Wc,-std=c++0x
07-06-2012 09:19 AM
07-11-2012 05:41 PM - edited 07-11-2012 05:41 PM
Hi Daniel,
Sorry it took me so long to get back, I have tried it and it failed on the next step, in qlist.h there is an include statement:
#include <initializer_list>
And it couldn't find this header.
I can see the header here: <SDK>/target/qnx6/usr/include/c++/4.6.3/initialize
/Developer/SDKs/bbndk-10.0.4-beta/target/qnx6/usr/
So I have to fix that by adding the following lines to the .pro file(I'm on Mac):
INCLUDEPATH += /Developer/SDKs/bbndk-10.0.4-beta/target/qnx6/usr/
INCLUDEPATH += /Developer/SDKs/bbndk-10.0.4-beta/target/qnx6/usr/
Is there a way to make that not platform specific?
07-12-2012 11:05 AM
Hi,
the bits/c++config.h file is platform specific, that's why it is hidden in the i486-pc-nto-qnx8.0.0 folder. Normally the default compiler should find this automatically but I suspect you may need to have to either create a new QCC config setting (Project Properties->c++ build->environment->QCC_CONF_PATH) and configure all of that for proper c++11 compilation.
(But that kind of defeats the purpose of having something non-platform specific I guess)
For now you may have to stick with
$(QNX_TARGET)/usr/include/c++/4.6.3
in your .pro file.
Cheers
Selom
07-12-2012 11:07 AM