0

I want to integrate a C++ function with the Matlab Legacy Code Tool.

The C++ function call looks like: void init(int argc, char* argv[], struct sStruct *pStruct)

What would be the corrosponding legacy code tool function specification. So far I have something like: void init(int16 p1, int8 p2[], sStruct work1[1])

but of course compiler cannot convert 'int8_T* {aka signed char*}' to 'char'**

matthias krull
  • 4,389
  • 3
  • 34
  • 54
  • Have you tried `int8 p2[][]` ? I agree that Matlab's documentation about this is quite crappy. – Benjamin Barrois Jul 09 '18 at 09:29
  • ya, but I think there is no such thing [][] in legacy code tool...still the same error – blackdestiny Jul 09 '18 at 09:33
  • According to documentation some stuff like this exists but I don't understand in what context : https://fr.mathworks.com/help/simulink/sfg/integrating-existing-c-functions-into-simulink-models-with-the-legacy-code-tool.html Else, `void**` seems to be possible, so maybe you can modify your C code passing `void**` instead of `char* []` and use `reinterpret_cast<>()` inside. There seem not to be an easy/non-intrusive solution to your problem unfortunately. – Benjamin Barrois Jul 09 '18 at 09:37

0 Answers0