필터 지우기
필터 지우기

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 CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by