フィルターのクリア

Standalone error : Accessible file is now inaccessible and mclFreeStackTrace

10 ビュー (過去 30 日間)
I have used matlab 2013b compiler to create a standalone application of my matlab code. I can install the standalone application but when I try to run it, it gives me two errors:
-Previously accessible file [C:\filepathtocode.m] is now inaccessible.
-Error in mclFreeStackTrace
My code is very simple :
function helloworld
figure
title('Hello, World.', 'FontSize', 12, 'FontWeight', 'Bold');
end
Here is a step-by-step of what lead me to this problem. To create the exe, I use deploytool into Application Compiler. I chose my main file and chose to have the run time downloaded form the web. Once its packaged, I run the installation successfully, but it always show me those two errors. What is causing this?
EDIT: I tried to install it on another computer and I only get the error about the mclFreeStackTrace. Also I have double checked that MCR version 8 is installed.
  2 件のコメント
Walter Roberson
Walter Roberson 2015 年 12 月 7 日
The C:\%filepathtocode.m -- is that literal, complete with the % character?
Louis-Daniel Théroux
Louis-Daniel Théroux 2015 年 12 月 7 日
No, its just the file path to the matlab code. I have edited my question to make it clearer, I am sorry for the confusion.

サインインしてコメントする。

採用された回答

Bharath Rangaswamy
Bharath Rangaswamy 2015 年 12 月 16 日
This might occurs because there are paths being added using ADDPATH in the startup.m or matlabrc.m file.
When a standalone application is compiled using MATLAB Compiler, the commands in the these files are also executed and these paths are not recognizable in the compiled standalone application. Hence, the error occurs.
To resolve this, use the "isdeployed" flag to ensure the commands in these files are not executed by deployed applications.
For example, if(isdeployed) % some code that does not have else addpath(...) end
An alternative is to just rename the startup.m and matlabrc.m file before building the standalone application. This workaround is explained below. 1. Find the location of these files with the commands below.
>> which -all startup.m >> which -all matlabrc.m
Some file might not be located in your directory and might 'not found' message.
2. Rename the files for which location is given. For eg., startup1.m , matlabrc1.m
3. Compile your application
4. Execute your standalone application and see if that solves the issue
5. Change the names of the files you renamed to 'startup.m' and 'matlabrc.m'.

その他の回答 (1 件)

Louis-Daniel Théroux
Louis-Daniel Théroux 2015 年 12 月 16 日
Used isdeployed to ensure the startup.m doesn't execute and now it works. Thanks you.

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by