add files & folders to 2025A compiler task manager

23 views (last 30 days)
Hello,
Since I've upgrated matlab to 2025A, I am struggling each time to compile a quite complex software.
1) The first mess is that my source code is located in different folders. I have to create a .prj file literally at the disk level (C://) is order to include all source code in my project (compiler task manager can only read children folders).
2) Despite setting my project at the disk level, I always get errors trying to add folders & files manually. I do it because the dependency analyzer cannot find some source code dependency which is under the "eval" function.
The folder I am trying to add to "Files Required for Standalone to Run" is a children of the project folder, and I am still getting this error with no information. Same when adding a file/multiple files.
Any help will be welcome.
Thank you very much,
Arthur

Accepted Answer

Image Analyst
Image Analyst on 13 Aug 2025
Having source code in different folders is no problem for compiling if your main program in the development environment can run and access them all. This means that they are on the search path and the mcc command will find any needed m-files that it needs. However if you're using the eval() function, you should probably not need to do that. See the FAQ:
I've written and compiled literally hundreds of complex programs in MATLAB and never ever have I had to use eval. It can very likely be recoded so that you don't need it and then all your dependent source code files would be found. Source code m-files that are in strings, like strings passed to eval, will not be detected by the dependency analyzer since it does not look inside strings for m-files and assume they might be run by a function such as eval() or system() or winopen().
If you have non source code files, then you can use a setup/installation builder software package like Centurion Setup to ship your other files (workbooks, images, sample data, text files, etc.). This is what I do. If you don't do that then you have to include all the non-m files that you want to be accessible by your program with the -a option of mcc. I don't use deploytool, I just manually write scripts called compile.m that do all the options and filenames and manually make up the mcc command. Let me know if you need a sample. If deploytool builds up an mcc command and you added additional files, then you should see them listed after the -a options (one file per dash a).

More Answers (1)

Arthur
Arthur on 13 Aug 2025

Thank you for your very complete response.

There are always alternatives to the eval function, including in my software I am replacing eval calls to a more appropriate manner.

I ended up doing like you and compiling from a script --> This way I will be able to automate my build stage in a near future instead of doing it manually and almost breaking my machine struggling with it ahahah.

I am interested in the tool centurion that you mentionned. I will investigate.

Merci beaucoup, Arthur

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!