Error when building model in simulink "Error(s) encountered while building model"

238 ビュー (過去 30 日間)
Naia North
Naia North 2017 年 7 月 5 日
コメント済み: Samir Huuu 2023 年 11 月 23 日
Matlab is failing to compile every block in my main. The error doesn't give me any other information except: "Error(s) encountered while building model" and then a list of all the blocks that failed to compile. The command window says "the make command returned an error of 2, 'An error occurred during the call to make' is not recognized as an internal or external command, operable program or batch file."
I'm using R2013a and one of the updates listed below must have deleted microsoft SDK 7.1 the other night. The code worked fine before these updates. After reinstalling .NET framework 4 and the SDK it's still failing to compile. I think it may be a problem with the mex or xpc setup or maybe I still need to reinstall something.
security update - microsoft visual studio 2010 xml editor
definition update - microsoft security essentials
security update - microsoft visual c++ 2008 service pack 1
security update - microsoft visual studio 2010
Any help would be appreciated

採用された回答

Naia North
Naia North 2017 年 7 月 6 日
In case anyone else has this problem, here's the fix:
  1. Uninstall .NET Framework 4 and above
  2. Uninstall SDK 7.1
  3. Uninstall visual studio 2010
  4. Reinstall visual studio 2010
  5. Install .NET Framework 4 (version 4.0.30319)
  6. Uninstall Visual Studio 2010 redistributable packages (x64 and 86)
  7. Reinstall SDK 7.1 (uncheck "Visual C++ compilers" and "microsoft visual C++ 2010" during reinstall)
  8. Install SDK 7.1 patch
  9. Install Visual Studio 2012 C++ Redistributable compilers (x64 and x86 version 11.0.61030)
  10. Install .NET Framework 4.6.1 (4.6.01055 version)
  11. Repair Visual Studio 2012 C++ compilers to be safe
  12. Restart computer
  13. set up the compiler in matlab (mex -setup and xpcsetCC)
  1 件のコメント
Mao Rothdamrong
Mao Rothdamrong 2023 年 9 月 26 日
"Error(s) encountered while building" error while building in Matlab Simulink, can you help?

サインインしてコメントする。

その他の回答 (4 件)

Mao Rothdamrong
Mao Rothdamrong 2023 年 9 月 26 日
"Error(s) encountered while building" error while building in Matlab Simulink, can you help?

yahhya
yahhya 2023 年 3 月 9 日
I was facing this problem from last couple of days and I had try this method to solve this problem
  1. Run Matlab run as administrator.
  2. The folder path should specify (Ex. This PC, E drive).
  3. Use folder name like Test_1 becuase I was using Test 1 so matlab could not read the floder path.
  3 件のコメント
yahhya
yahhya 2023 年 3 月 17 日
I think you should shorten your file name, also mention file path properly.
Samir Huuu
Samir Huuu 2023 年 11 月 23 日
I solved the problem successfully by this method.

サインインしてコメントする。


Serkan Budak
Serkan Budak 2023 年 4 月 5 日
I'm getting "Error(s) encountered while building" error while building on Stm32f4xx card in Matlab Simulink, can you help?

Swapnali
Swapnali 2023 年 10 月 5 日
Error(s) encountered while building" error while building in Matlab Simulink, can you help?

カテゴリ

Help Center および File ExchangeTroubleshooting in MATLAB Compiler SDK についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by