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.

Harry
  • 2,177
  • 1
  • 19
  • 33
  • 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. – DeathTails Mar 30 '16 at 13:15
  • @Tails Thanks for your help – Harry Mar 30 '16 at 13:21

6 Answers6

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.

KimKulling
  • 2,654
  • 1
  • 15
  • 26
  • 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 mutex – Harry May 19 '16 at 12:01
  • If you are able to use C++11: check the cppreference: http://de.cppreference.com/w/cpp/atomic/atomic – KimKulling May 19 '16 at 12:06
  • 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.7 – Harry May 19 '16 at 12:10
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.

DeathTails
  • 468
  • 4
  • 12
  • 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 mutex – Harry May 19 '16 at 12:00
  • @Harry 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. – DeathTails May 19 '16 at 13:23
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

Not Saying
  • 194
  • 11
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

mpatrich
  • 11
  • 1
0

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

unnamed
  • 840
  • 9
  • 26
  • 38
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.