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.
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.
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.
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.
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
The latest vxworks version comes with c++17 support (C++17, Boost, Python, and Rust collection) https://www.windriver.com/news/press/pr.html?ID=22444
With the new Vxworks 7 SR600, C++11 is supported with clang compiler.
I had worked in real-time embedded systems for about 25 years, mostly in avionics, and as I recall, standard template libraries are generally not allowed, due to their use of uncontrolled dynamic memory allocation and uncontrolled thread creation. Maybe that has changed, but that's likely why most flavors of VXworks eschew STL's.
© 2022 - 2024 — McMap. All rights reserved.