MATLAB: Does MATLAB 7.0 (R14) crash when I use a structure from a shared library that contains a type char ** member

**chardlllibrarylibstructloadlibraryMATLABsharedstringstringsstructstructure

I am using LOADLIBRARY to load a shared library into MATLAB. The header file for my shared library defines a structure that contains a variable of type char as a member. For example, the header contains the following type definition for top_struct:
typedef struct {
int one;
char **two;
} top_struct;
I then use the following code in MATLAB to create a top_struct structure and access it:
h=libstruct('top_struct');
get(h)
h.one=int32(1);
get(h)
When I execute this code, MATLAB issues a segmentation violation.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
We have verified that there is a bug in MATLAB 7.0 (R14) in the way that LOADLIBRARY handles the char C type.
To work around this issue, try using the char * data type as a replacement.