Matlab code to C++ classes in 2018 VS 2019
3 views (last 30 days)
Bogdan Iliuta on 11 Oct 2019
I'm interested in converting some matlab code to C++ classes but if I inspect the documentation of 2018 and 2019 versions it seems that CppInterfaceStyle is missing from coder.CodeConfig. Can you please confirm that this is only available in 2019 codegen version? If so, the 2018 codegen will not generate any C++ classes?
Another question is about genereting code for Matlab containers.Map or use of jsondecode(). It seems that using the default codegen configs it's not possible to generate C/C++ code if you want to use any of those. I can understand that this may be mathworks proprietary code and it can't be added in plain text to the generated C/C++ files, but is there a library (.so or .dll) and some header files to which I could link in order to be able to use Map and json parser ?
Denis Gurchenkov on 11 Oct 2019
The CppInterfaceStyle config parameter has been added in R2019b. In prior releases, it is not possible to generate C++ classes using MATLAB Coder.
For containers.Map and jsondecode, one workaround is to use coder.ceval and coder.opaque to integrate C/C++ code (generated from MATLAB) with some third-party C or C++ library that does these tasks.