Clear Filters
Clear Filters

Errors with ext_work.c file generated with Simulink Coder

1 view (last 30 days)
Hello,
I am working within a team that is attempting to generate C code using Simulink Coder.
When we attempt to generate code using the sldrt.tlc System Target File, it does not generate an executable file. In order to mitigate this issue, we are attempting to compile the C source code that was generated with Simulink Coder. We are using gcc/clang.
However, we are running into an issue with compiling. When attempting to compile the file ext_work.c, numerous errors are generated.
The most common error is:
ext_work.c:126:1: error: expected identifier or '('
{
^
This error is associated with the following code snippet:
void rtExtModePauseIfNeeded(RTWExtModeInfo *ei,
int_T numSampTimes,
boolean_T *stopReqPtr)
{
while((modelStatus == TARGET_STATUS_PAUSED) &&
!startModel && !(*stopReqPtr)) {
rt_ExtModeSleep(0L, 375000L);
rt_PktServerWork(ei,numSampTimes,stopReqPtr);
#ifndef EXTMODE_DISABLESIGNALMONITORING
rt_UploadServerWork(numSampTimes);
#endif
}
startModel = false; /* reset to false - if we were stepped we want to
* stop again next time we get
* back here.
*/
} /* end rtExtModePauseIfNeeded */
I have checked the file for missing curly brakets, but did not find any. The file appears "correct".
I have attached a .txt document with the entire terminal output.
I have also atttached ext_work.c and ext_work.h as .txt files. In order to post the .c and .h files, they had to be coverted to .txt files and their names changed to avoid being named the same thing. Aside from that, the files have been unedited from their original generated state.
The user in this post/thread described the same issue. However, the post/thread does not offer a solution for this issue.
Could someone help with this issue?
Thank you!
Matt

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!