1. Wind River Workbench
  2. Wind River Workbench 3.1 Download

In Visual Studio 2010, I was able to build enumeration with datatype just fine.

Wind River Workbench 3.1 Download Windriver Workbench 3.1 Download. Software development and applications programmin on Linux. YoLinux: Linux.

However, when I tried to compile in WR Workbench, I get the following error:

: error: use of enum 'FRUIT_E' without previous declaration

I really need to specify the datatype of enum as fields are bitpacked. Is there any way I could explicitly specify the type of enumeration?

JustinJustin

1 Answer

The short answer to your question is no.

Wind

The ability to define a base type for enumerations is a language feature that was not added until C++11 (http://en.cppreference.com/w/cpp/language/enum). Unfortunately, WindRiver has been slow to support compilers that comply with modern C++ standards (C++ 11 in vxworks). There is mention of support for C++11 in commercial versions of g++ for VxWorks 7.0+ (https://stackoverflow.com/a/36311473). But, your WorkBench version (<4.0) implies that this won't be helpful to you.

In your situation, I might cobble together a work-around, such as this:

However, this won't provide type safety, as FRUIT_T is just an alias for UINT16. So, it's far from ideal. I've added tags to your question. There may be better work-arounds, emulating the desired behavior more closely. But, the addition of a new language feature would seem to indicate that existing methods were inadequate.

Community

Wind River Workbench

Cliff BilbreyCliff Bilbrey

Wind River Workbench 3.1 Download

Not the answer you're looking for? Browse other questions tagged c++c++11vxworkswind-river-workbench or ask your own question.

Posted on  by  admin