Scenario:
I'm compiling a project which uses a lot of external files\functions.
When I compile, I use a function which includes all of said files into the mcc command with the '-a' argument.
Everything seems to be in place and working fine after compilation, EXCEPT one text file - in which case, Matlab seem to include a text file (with the same name) from an earlier iteration of the project (I can tell, because the text in the file is different).
Some more details:
When I include the external files, I do so by adding the paths of all the sub-folders residing in the directory of the project.
After compilation is done, all of said paths are removed from Matlab's paths.
No paths other than Matlab's default paths are added before and after compilation.
When I run the project from the .m file, the correct text file is used, but after compilation, the wrong one is used.
Yes the -a includes everything in a directory, even those not on the MATLAB path. I have also had problems of files having the same name, perhpas only differing by case with compiled programs. So do not have two files, or rename one of them.
What I would prefer, if I were doing this, is not use the -a flag. Everything you need for your project should be in one directory, so there are no confusions in the compilation with other files in other directories.