Filter löschen
Filter löschen

Building non-inlined S-function with .c file present alongside the .cpp is causing Simulink (with Matlab R2015a) to use the .c file in the build process for the model even though the actual .mexw64 file was generated for C++.

1 Ansicht (letzte 30 Tage)
I had built a .cpp S-function with mex. After generating the code for the model, the built .exe kept crashing. So after some digging, I went into the debugger and noticed it is calling a non-existent mdlStart() in the .exe. There was a mdlStart() in my .cpp file, but the dummy .c file which was also present didn't have it and it was the .c file for some reason that was compiled during the build process, even though the .mexw64 file I had generated was for the .cpp file. Is this a bug?
  1 Kommentar
Jordan Ross
Jordan Ross am 23 Sep. 2016
Hi Raghu,
In your model configuration parameters, do you have the code generation language selected to be C or C++?
Since your S-function is compiled in C++, I would try setting the code generation language to C++ in the model configuration parameters.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Block and Blockset Authoring finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by