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!