code generation errors, mex compile works fine
Afficher commentaires plus anciens
I have written a s-function and then a tlc-file for code generation with embedded coder.
My s-function builds perfectly and also works fine within the simulink simulation.
However, when i build the model to generate code with embedded coder, I get the following error.
c:\program files\matlab\r2017a\extern\include\matrix.h(91): error C2061: syntax error: identifier 'mxLogical'
c:\program files\matlab\r2017a\extern\include\matrix.h(91): error C2059: syntax error: ';'
c:\program files\matlab\r2017a\extern\include\matrix.h(96): error C2061: syntax error: identifier 'mxChar'
.
.
.
Find attached file for complete log of the errors.
It looks like, code generation was successful but it could not build.
There are a lot of threads with similar problems but none have a clear answer to why this happens.
I have tried all the answers in the other threads, but I still have the same problem.
Can someone please explain what is happening and how can this be solved.
6 commentaires
Kaustubha Govind
le 4 Jan 2018
Are you including matrix.h for the embedded code generation? If yes, perhaps you also need to include mex.h?
Shivaram Singh Rajput
le 4 Jan 2018
Modifié(e) : Walter Roberson
le 4 Jan 2018
Kaustubha Govind
le 4 Jan 2018
If you have a TLC, the S-function .c will not be used for code-generation, which is probably why you didn't see any change. The error is very strange. It almost seems like a compiler issue, but I can't be sure. Do your TLC modify the model header section, or do you include any custom headers using rtwmakecfg.m?
Shivaram Singh Rajput
le 8 Jan 2018
Kaustubha Govind
le 17 Jan 2018
Any idea how simstruc.h is getting included? Is the S-function .c file getting included in the generated code for the model? This shouldn't happen when you have a TLC, so it makes me wonder if your TLC isn't getting recognized for some reason.
Shivaram Singh Rajput
le 18 Jan 2018
Réponses (1)
Mark McBroom
le 25 Fév 2018
0 votes
Sounds like your TLC file isn't being located. Make sure TLC file is in same directory as .mexw64 file for your s-function. You could also purposely introduce a syntax error into your TLC code or set a breakpoint (%breakpoint) in your TLC code to verify that it is being located and executed.
Catégories
En savoir plus sur Simulink Coder dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!