Why I can't generate c++ code only using simulink coder?

17 ビュー (過去 30 日間)
dm b
dm b 2017 年 8 月 22 日
編集済み: Kurt Stewart 2019 年 3 月 26 日
When I try to generate code using simulink coder I see the following error:
The specified code generation target is configured to generate C++, but the C-only compiler, LCC, is the default compiler. To allow code generation, you can select any C++ compiler from the Toolchain pulldown as well as selecting the 'Generate code only' option. To generate C code, open the Configuration Parameters dialog and set the target language to C. Or, to specify a C++ compiler, enter 'mex -setup' at the command prompt. For details on supported C++ compiler versions, see http://www.mathworks.com/support/compilers/current_release
I want just generate C++ code only, do not use any compilers. I have activated this option. I think the reason of this error is "generate makefile" option, that is enabled. But it is read only and I can't deactivate it. How can I generate C++ code without using any compilers?

回答 (2 件)

Walter Roberson
Walter Roberson 2017 年 8 月 22 日
You cannot do that. If I recall correctly, one of the intermediate steps in code generation involves generating a program and running it.
  2 件のコメント
dm b
dm b 2017 年 8 月 22 日
I don't know about simulink coder, but matlab coder alllows to generate code without any compilers using. For this purpose option "generate code only" must be activated and option "generate makefile" must be deactivated. But I can't deactivate "generate makefile" option in simulink coder beacause it is read only (why?).
Tuncay  ÖLÇER
Tuncay ÖLÇER 2018 年 7 月 11 日
I have also got exactly the same answer. Is there any possible solution to this problem? Thank you.

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


Kurt Stewart
Kurt Stewart 2019 年 3 月 26 日
編集済み: Kurt Stewart 2019 年 3 月 26 日
Probably because it is trying to create an executable out of the code and you can only do that using a compiler. Just add one it isnt not hard you can do so through Matlab add-ons or gcc, g++ compilers are standard free software

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by