MATLAB Answers

Got error in compiling standalone app 2018a

33 views (last 30 days)
JFz
JFz on 17 May 2018
Answered: Image Analyst on 4 Jan 2020
Hi,
I am compiling a simple matlab file and got this error:
Compiler version: 6.6 (R2018a)
Dependency analysis by REQUIREMENTS.
[Warning: Your deployed application may error out because file or folder paths not present in the deployed environment may be included in your MATLAB startup file. Use the MATLAB function "isdeployed" in your MATLAB startup file to determine the appropriate execution environment when including file and folder paths, and recompile your application. ] Could not determine type of the MATLAB file 'runCost.m'. Please make sure that you are compiling MATLAB Program files.
What does the above mean? My file runCost.m is a Matlab Program file. Why is ti complaining?
Thanks for any input.

  2 Comments

Sign in to comment.

Answers (2)

Denis Stanescu
Denis Stanescu on 4 Jan 2020
Hello! Have you solve this error? I have the same error and i am trying to solve it. Can you help me?

  0 Comments

Sign in to comment.


Image Analyst
Image Analyst on 4 Jan 2020
You somewhere, either in
  1. your main m-file
  2. dependent m-files
  3. your startup.m file
have a path hard-coded in. When you deploy this to some end-user's computer, it's possible/likely that they won't have that exact path on their computer and thus an error will get thrown when your code tries to use that path.
For example if you use cd in your startup.m file, that startup.m code gets run even on the end-user's computer. To prevent a cd to some folder that they don't have you could wrap it in isdeployed so that the code does not run on their computer:
if ~isdeployed
% It's not deployed. It's my development computer so I can cd to a folder on my drive
cd('c:/folder/on/myDrive');
else
% It's the compiled, standalone executable.
% Don't change directory because they may not have that folder.
end
However the warning is not smart enough to check if the path is, in fact, within an isdeployed so it will still warn you even if you did the above. I know for a fact because I have this exact situation.
Another situation might be if you referred to a file with a specific path, like
fileName = 'c:/my data/input data.xlsx';
data = xlsread(fileName);
It's warning you that your end user may not have input data.xlsx in that folder "C:/my data".
But if you know for a fact that you've handled hard-coded paths correctly, like use isdeployed or make sure you shipped and installed needed files in the folders where you expect to get them, then you can ignore the error. Otherwise correct the path or else your user will get an error.

  0 Comments

Sign in to comment.

Sign in to answer this question.