Generated and compiled main file does not execute

4 visualizaciones (últimos 30 días)
Nanda Thanigaivelan
Nanda Thanigaivelan el 20 de Dic. de 2020
Comentada: Ryan Livingston el 30 de Dic. de 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 comentario
Ryan Livingston
Ryan Livingston el 30 de Dic. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by