Mex compiler used for referenced protected model

4 次查看(过去 30 天)
Hi,
I have a model ("Validation") referencing two protected (one of them "Aircraft_Model") models in accelerator mode.
On my PC this model is compiling without any problems, on my laptop however I get following error (so far only for one of the protected models).
With following parameter differences:
For all three models I have the same settings in Model Parameters -> Code Generation. Ert.tlc and MinGW64 as compiler.
Additionally, when typing 'mex -setup' in the command line, for PC and Laptop MinGW64 is set as a compiler for C and C++. And both use the same version and update of MATLAB.
I didn't find any helpful tips on the internet about solving this issue.
Does anyone has an idea how to solve the issue?
Thanks a lot,
Raphael

回答(1 个)

Infinite_king
Infinite_king 2023-12-18
Hi Raphael Eckfeld,
I understand that you're having trouble generating a Mex file for a Simulink model that includes protected models.
The possible reason for this issue could be a misconfiguration of code generation settings. Follow the steps below to cross-check the model settings across different devices,
  1. Open your Simulink model.
  2. In the ‘MODELING’ tab, select ‘Model Settings’ option.
  3. In the "Code Generation" section, check the ‘Target selection’ and ‘Build Process’ settings.
  4. Check the ‘Toolchain’ and ‘Toolchain details’.
  5. Update the setting such that it was compatible with the device you are using.
  6. Click "Apply" and then "OK" to save the changes.
  7. Attempt to generate code again.
In addition, you can follow the below general troubleshooting steps,
  1. Ensure that the versions of MinGW64 on both systems match.
  2. Verify that the paths to MinGW64 are correctly set on both systems. Check the system path by typing getenv('PATH') in the MATLAB Command Window.
  3. Ensure that necessary environment variables, such as MW_MINGW64_LOC, are correctly set on both systems.
  4. Look for any MATLAB add-ons or toolboxes installed on your PC that might be relevant to the compilation process. Check if your laptop is missing a specific toolbox or add-on that the model references.
  5. Clear temporary files in MATLAB using the clear and clear mex commands in the Command Window.
For more information, refer the following MATLAB documentation,
  1. https://www.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-matlab
  2. https://www.mathworks.com/matlabcentral/answers/417590-why-clear-mex-needed
  3. https://www.mathworks.com/help/simulink/slref/protected-models-for-model-reference.html
Hope this is helpful.

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by