C++ 11 in vxworks
Asked Answered
L

6

7

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.

Leonteen answered 30/3, 2016 at 13:9 Comment(2)
I work with VxWorks as well and I highly doubt it. I don't have enough information to say exactly that it does or not, but until recently they had major problems with templates. We've been stuck programming in C for the longest time because of this. I'll ask around a bit at work and see if someone else here knows more than I do. Because I would love to have this as well.Pinch
@Tails Thanks for your helpLeonteen
M
4

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.

Mediatory answered 30/3, 2016 at 14:13 Comment(3)
Hi KimKulling do u know any way to atomically set and get the values of any variable(char int float) that works both in vxworks and linux without using mutexLeonteen
If you are able to use C++11: check the cppreference: de.cppreference.com/w/cpp/atomic/atomicMediatory
Thanks for the reply. Actually we are using vxworks 6.7 and ppcgnu compiler. So I think this version doesn't support c++11 standard in vxworks 6.7Leonteen
P
3

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.

Pinch answered 30/3, 2016 at 14:9 Comment(2)
Hi DeathTails do u know any way to atomically set and get the values of any variable(char int float) that works both in vxworks and linux without using mutexLeonteen
@Leonteen I'm not too familiar with VxWorks threading. I know we use their tasks and semaphore locks for our application, but I don't know of anything about their atomics or compatibility with Linux. You'll probably be better off asking that as a separate question.Pinch
E
1

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

Encamp answered 26/1, 2018 at 18:35 Comment(0)
E
1

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

Exhibitionism answered 19/2, 2020 at 8:32 Comment(0)
D
0

With the new Vxworks 7 SR600, C++11 is supported with clang compiler.

Dracaena answered 17/10, 2019 at 20:7 Comment(0)
V
0

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.

Violist answered 29/9, 2020 at 17:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.