Filter löschen
Filter löschen

Generated and compiled main file does not execute

2 Ansichten (letzte 30 Tage)
Nanda Thanigaivelan
Nanda Thanigaivelan am 20 Dez. 2020
Kommentiert: Ryan Livingston am 30 Dez. 2020
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 Kommentar
Ryan Livingston
Ryan Livingston am 30 Dez. 2020
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by