MATLAB: Do I receive error messages when trying to compile an mwArray structure array

ccompileconstructorlibraryMATLAB Compilermwarrayplusstructutility

When I attempt to compile an example mwArray structure array using the example found by running the command:
web([docroot,'/toolbox/compiler/api_appendix34.html#93221'])
I receive the following error messages:
comptest.cpp(5) : error C2440: 'initializing' : cannot convert from 'const char [2]' to 'char ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
comptest.cpp(5) : error C2078: too many initializers
comptest.cpp(6) : error C2664: 'mwArray::mwArray(int,int,mxClassID,mxComplexity)' : cannot convert parameter 4 from 'char ** ' to 'mxClassID'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
Why do I receive these errors?

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This has been verified as an error within the documentation for the MATLAB Compiler 4.1 (R14SP1) within the mwArray function reference. The code should read as follows:
#include "mclcppclass.h"
const char* fields[] = {"a", "b", "c"};
mwArray a(2, 2, 3, fields);