mcc insensitive to -a and -I options

4 visualizzazioni (ultimi 30 giorni)
Niclas Madsen
Niclas Madsen il 4 Mag 2022
Risposto: Image Analyst il 11 Dic 2023
Hi,
I'm building (or attempting) a standalone .exe of a function I use often. It is a process that I wish to run continuously on a server. The function has many depandancies in a large folder with several subfolders. This directory is rigid and not only I use it. Furthermore, the function has successfully been compiled before, but I don't know why these errors exist now.
My command for generating the executable
mcc -o output_fcn_name ...
-W main:fcn_name ...
-T link:exe ...
-v X:\folder\sub_folders\fcn_name.m
This code is based on unsuccessful attempts using the deploytool. When using the deploytool the executable does not show the disp('') commands I've put throughout the function to track my progress. However, this command results in the following error:
'[missing_function_name]' is not found in the current folder or on the MATLAB path, but exists in:
C:\folder\sub_folders
Change the MATLAB current folder or add its folder to the MATLAB path.
This is strange for several reasons:
  1. The function IS on the Matlab path when compiling. I can call it and which -all missing_function_namme returns the location
  2. Adding the function to the mcc command line by -a C:\folder\sub_folders\missing_function_namme.m does not correct the error
  3. I can see the function in the C:\Users\usr_name\AppData\Local\Temp\usr_name\mcrCache9.3\ folder in the correct folder\subfolder
  4. This error is thrown deep in the executable function. Several functions in the same overall C:\folder\sub_folders\ has been successfully called
I can solve the issue by putting the function in the current folder, but it then throws the same error for the next subfunction from that same folder tree.
I'm working on some X:\ drive calling dependancies from the C:\ drive if that is relevant. My working directory is X:\folder\sub_folder
Any suggestions?
Thank you!
-a C:\folder\sub_folders
-I C:\folder\sub_folders
Doesn't fix the error either
EDIT: spelling errors
  1 Commento
Niclas Madsen
Niclas Madsen il 4 Mag 2022
I've tried several things:
mcc -o output_fcn_name ...
-W main:fcn_name ...
-T link:exe ...
-v X:\folder\sub_folders\fcn_name.m ...
-a C:\folder\sub_folders
and
mcc -o output_fcn_name ...
-W main:fcn_name ...
-T link:exe ...
-v X:\folder\sub_folders\fcn_name.m ...
-a C:\folder\sub_folders\missing_function_name.m
and
mcc -o output_fcn_name ...
-W main:fcn_name ...
-T link:exe ...
-v X:\folder\sub_folders\fcn_name.m ...
-I C:\folder\sub_folders\
etc...

Accedi per commentare.

Risposte (2)

Infinite_king
Infinite_king il 11 Dic 2023
Hi Niclas Madsen,
I understand that you are trying to generate executable using MATLAB Compiler and facing ‘file not found on the MATLAB Path issue’.
One of the reasons for this error is not having read/write permission in the location where files are located. To resolve this error, follow the below troubleshooting steps,
  1. Try to open MATLAB in administrator mode.
  2. If you are using MATLAB Compiler from command prompt, then open Command prompt in Administrator mode.
  3. Check if your user account has necessary read/write permissions.
  4. If your use account doesn’t have necessary permissions, obtain the read/write permission.
  5. Use ‘-m’ flag instead of ‘-W’ flag, refer the following example as a reference, https://www.mathworks.com/help/compiler/mcc.html#d126e22440:~:text=collapse%20all-,Create%20Standalone%20Application,-Create%20a%20standalone
For more information, refer the following MATLAB documentation,
  1. https://www.mathworks.com/help/compiler/mcc.html#d126e21855
  2. https://www.mathworks.com/help/compiler/standalone-applications.html
Hope this is helpful.

Image Analyst
Image Analyst il 11 Dic 2023
Your folder might have spaces in it, like "C:\Program files\"
Try enclosing the folders in double quotes:
mcc -o output_fcn_name ...
-W main:fcn_name ...
-T link:exe ...
-v "X:\folder\sub_folders\fcn_name.m" ...
-I "C:\folder\sub_folders\"
If that doesn't work, try the function version of mcc instead of the command line version
mcc("-o", "output_fcn_name", ...
"-W", main:fcn_name, ...
"-T", link:exe, ...
"-v", "X:\folder\sub_folders\fcn_name.m", ...
"-I", "C:\folder\sub_folders\")
If it still doesn't work, call tech support.

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by