问题
I am new to VxWorks and I am developing a software using C++ in VxWorks platform. I want to know whether VxWorks compiler supports C++ 11 standard. The reason I am asking this question is because there is no shrink_to_fit() std::vector function available(this function is introduced in c++ 11 standard). So I want to know is there any way to compile the code with C++ 11 standard in VxWorks.
回答1:
There are commercial versions of g++ available for vxWorks, which are supporting c++11. As far as I know these ports of g++ are available for vxWorks 7.0 or higher.
回答2:
I'm assuming you're using the WindRiver (diab) compiler, which is also what we're using for our VxWorks platform. If that's the case, I found a pdf on their website that pretty clearly outlines that they are compliant only up to C++03.
Link to the pdf
Support for ANSI C89, C99, and C++ 2003
Apparently, VxWorks also has GNU and ICC compiler support, but I'm not as familiar with how they work with VxWorks.
回答3:
Only in VxWorks 7. The diab that ships with VxWorks7 still does not support C++11.
GnatPro 17.1 ships with gcc 6.2.1 and works with VxWorks.
You might be interested in: http://en.cppreference.com/w/cpp/compiler_support
回答4:
With the new Vxworks 7 SR600, C++11 is supported with clang compiler.
来源:https://stackoverflow.com/questions/36309858/c-11-in-vxworks