However, I open a new question since the other question has been marked as answered, even if the problem persists.
Background
I am working on a large simulation software that contains many classes and files organized in folders and subfolders. The parent folders are included in the path options passed to the compiler with the -p option. I need to compile the software to be able to run it on a computation cluster without using Matlab licenses which are limited in my research institute.
Note: All the examples from PATH_TO/matlab/R2014a/extern/examples/compiler could be compiled successfully and passed the tests in my environment, using the compiler from version R2014a.
The code runs successfully in a desktop Matlab session.
Matlab version 2014a 8.3.0
Matlab MCR version 8.3
Linux 64 bits
gcc version 4.7.2
Problem
When compiling with command
mcc -o runSimulation -W main:runSimulation -T link:exe -d ./bin/runSimulation -p bioinfo -p curvefit -p images -p optim -p signal -p stats -N -w enable:specified_file_mismatch -w enable:repeated_file -w enable:switch_ignored -w enable:missing_lib_sentinel -w enable:demo_license -R -nodisplay -R -singleCompThread -v ./bin/runSimulation.m -a LONG_LIST_OF_ALL_MATLAB_FILES
I always get dependencies error like:
Error using getSymbolNames (line 145) Import argument "SOME_CLASS_NAME" in MATLAB code 'SOME_MATLAB_FILE.m' cannot be found or cannot be imported.
Error in matlab.depfun.internal.MatlabInspector/analyzeSymbols (line 152) [F, S] = getSymbolNames(symbol.WhichResult);
Error in matlab.depfun.internal.Completion/findDependentFiles (line 1057) analyzeSymbols(inspector, symbol);
Error in matlab.depfun.internal.Completion/computeDependencies (line 234) findDependentFiles(obj);
Error in matlab.depfun.internal.Completion/computePartsList (line 1581) computeDependencies(obj);
Error in matlab.depfun.internal.Completion/requirements (line 1890) parts = computePartsList(obj, false);
Error in matlab.depfun.internal.requirements (line 191) [parts, resources.products, resources.platforms] = c.requirements();
Unexpected error while determining required deployable files. Compilation terminated.
What I tried to solve the problem
I tried to include ALL the subfolders (not only the parent folders) by passing them with the -p option or the -I option to the compiler.
I tried to change the order of the files passed the compiler. In this case I get the same error but referring to another import statement in a different file.
In a Matlab desktop session, by setting the correct paths with the addpath() function, I can import the mentionned class without any problem. Therefore, it seems to be a problem related to the Matlab compiler.
If I comment out the import statement and use the absolute package prefix for the external class the error disappears in the compiler. However, this would be a very bad solution since it implies manually correcting all the import statements, substituting class names with their prefix in all files.