classdef MyPosition < handle
X (1,1) double {mustBeReal}
Y (1,1) double {mustBeReal}
function obj = MyPosition(X,Y)
X (1,1) double {mustBeReal}
Y (1,1) double {mustBeReal}
Matlab compiler sdk supports creation of an C++ MATLAB Data API shared library from strongly typed MATLAB classes.However, the code attached with the official documentation uses the value class, so I modified it a little bit to make it a handle class, as shown above. But the compiler sdk app reports error:
Preparing Runtime...
mcc -W 'cpplib:calculatearea,generic' -T link:lib -d D:\Learn\matlabSDK\strongly_typed_noNameSpace\output\cpp_compilerSDK_GUI -v D:\Learn\matlabSDK\strongly_typed_noNameSpace\MyPosition.m
Compiler version: 8.3 (R2021b)
Analyzing file dependencies.
Error: Failed to generate file "D:\Learn\matlabSDK\strongly_typed_noNameSpace\output\cpp_compilerSDK_GUI\calculateareav2.hpp".
mcc failed.
The error log was quite simple so I did not know what to do. The error dispeared, however, if I simply deleted "<handle" to make a value class back again. My question is: Is this a limitation of matlab compiler sdk that it can only deal with value class? Or did I miss something like an option flag that needs to be set?