Got error in compiling standalone app 2018a

조회 수: 6 (최근 30일)
JFz
JFz 2018년 5월 17일
답변: Image Analyst 2020년 1월 4일
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
Walter Roberson
Walter Roberson 2018년 5월 17일
is runCost.m a script or a function?
JFz
JFz 2018년 5월 17일
Thanks. It is a function.

댓글을 달려면 로그인하십시오.

답변 (2개)

Jessie Bessel
Jessie Bessel 2020년 1월 4일
Hello! Have you solve this error? I have the same error and i am trying to solve it. Can you help me?

Image Analyst
Image Analyst 2020년 1월 4일
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.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by