Why do I receive an undefined function or variable error in a standalone application?
古いコメントを表示
I'm trying to build a standalone application that reads data from an excel file and writes some results into the same file (I use xlsread and xlswrite).
When I launch my program from the MATLAB Editor it works fine, but after building the standalone and running it, I get this error:
??? Undefined function or variable 'myfun'. MATLAB:UndefinedFunction"
I build my standalone using the deploytool; including myfun.m in "main function" folder. This should be something similar to "mcc -m myfun.m"
Does anybody know how to fix this problem?
7 件のコメント
Aurelio
2011 年 2 月 7 日
You must try it with MATLAB Builder EX
Kaustubha Govind
2011 年 2 月 7 日
What is 'myfun' in your code? Also, are you running the executable on a machine that has Excel installed?
Unai
2011 年 2 月 7 日
Todd Flanagan
2011 年 2 月 7 日
I don't think this has anything to do with xlsread or xlswrite. It doesn't look like you function is running in the standalone. Could you edit your question and include the mcc command you used to build the standalone? That would be very helpful.
Unai
2011 年 2 月 8 日
Joana borges
2013 年 7 月 4 日
Hi! I´m having a similar problem now with my standalone. I didn´t understand how you´ve solved it. Where do I type 'MCR_CACHE_ROOT=%TEMP%\%USER% '? Is this permanente (I only have to do it once or every time i run the standalone)?
Walter Roberson
2013 年 7 月 5 日
In MS Windows, you can use the registry editor to create environment variables, but you would not typically do that.
In MS Windows, if you access the icon properties of the icon you use to launch your executable, then you can create environment variables as specific properties (I think. It's been a long time.)
In MS Windows, if you need to, you can edit the command line associated with the icon so that the icon creates the environment variables before running the executable. I do not know how that would be done.
In MS Windows, if you need to, you can swap out the actual executable name associated with an icon so that you instead name a .bat file, and the .bat file sets the environment variables and then runs the real executable.
回答 (1 件)
Walter Roberson
2011 年 2 月 7 日
0 投票
Unless you have the most recent version, the compiler can only compile functions and not scripts.
1 件のコメント
Bachtiar Muhammad Lubis
2019 年 7 月 24 日
by the way i face this problem as well.
i get this error "Undefined function or variable 'application'". when trying to run my .exe file (output after installing the applicationCompiler output).
what should i do to fix this ?
and why this is happened Walter?
:(
thanks in advance
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!