필터 지우기
필터 지우기

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 (최근 30일)
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
Jordan Ross
Jordan Ross 2016년 9월 23일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by