フィルターのクリア

Generated and compiled main file does not execute

2 ビュー (過去 30 日間)
Nanda Thanigaivelan
Nanda Thanigaivelan 2020 年 12 月 20 日
コメント済み: Ryan Livingston 2020 年 12 月 30 日
Hi,
I followed the instructions for generating code as dll and used with VS 2019. It did worked as expected. Unfortunately, our deployement system is linux. So I tried to generate code using Matlab coder for library along with main file. I also assigned generate and compile option in order to create executable output for the generated main file. When I tried to run the complied main file, i.e., main.o, in the terminal, it returned permission denied, then tried execute as superuser, it returned command not found. I also tried chmod +x but it returned cannot execute binary file, exec format error.
I used the following configuration for code generation
cnfig = coder.config('lib');
cnfig.GenerateExampleMain = 'GenerateCodeAndCompile';
cnfig.GenerateReport = true;
codegen -config cnfig function_x1 -args params
May I know what went wrong here?
How do I solve this issue?
  1 件のコメント
Ryan Livingston
Ryan Livingston 2020 年 12 月 30 日
Are you generating and compiling the code on linux? If so, you should see a file called function_x1 in your pwd. That's the executable, not main.o. If you don't see that file, please paste the output of !ls -l in the folder from which you ran codegen.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by