how do I override rt_main in embedded coder?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Using embedded coder to generate code, I want to exclude rt_main.c from the build and use my own customized version (since the one that gets included does not actually run any of my code). I see that I can generate an example main program (ert_main.c) but I don't see how I can incorporate my customized version of that file into the build. I can add my own main function to the build, but then I get a linker error because main is defined twice. How do I write a customized main function?
0 comentarios
Respuestas (1)
Vandit
el 31 de Mayo de 2023
Hi,
To modify main function ‘ert_main.c’, you can navigate to ‘Model_Name_ert_rtw’ folder and customize ‘ert_main.c’ file as per your requirements.
Now to generate a new executable, please refer to the steps shown below:
1. Inside the ‘Model_Name_ert_rtw’ folder, delete all ‘.obj’ files.
2. Delete the already existing ‘Model_Name.exe’ file from your current working directory.
3.Run the ‘Model_Name.bat’ file by running the command ‘!Model_Name.bat’ in the command window to generate the executable again.
Hope this helps.
Thankyou
3 comentarios
serena aiello
el 26 de Oct. de 2023
Hi Paul, I want to do the same thing. Do you have find an automatic solution?
Ver también
Categorías
Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!