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