Runtime errors in compiled standalone
Ältere Kommentare anzeigen
Hi! I'm trying to figure out why my compiled standalone app, whose source runs fine within Matlab, is crashing. First I was getting the "File not found" error, despite the fact that the file it couldn't find is in the very same directory as the "main" file. So I went ahead and explicitly included the file in the project; that got me past that File not found error, but the log file my program generates indicates theat the program kept throwing an "Unable to checkout a license for" error...when it gets to one of my files! (Though the path it gave for it--it's the same file each time, a classdef m file that gets called inside a loop--seems somewhat suspect: it's finding it under C:\Users\dgol461\AppData\Local\Temp\dgol461\mcrCache7.16\Proces16\). And when it gets to my closing "clean-up" routine, it again crashes w/ the File not found error, again despite the presence of the unfound file in the same directory as the main.
Please help; thanks!
1 Kommentar
David Goldsmith
am 16 Jan. 2013
Bearbeitet: David Goldsmith
am 16 Jan. 2013
Antworten (5)
Image Analyst
am 14 Jan. 2013
Bearbeitet: Image Analyst
am 14 Jan. 2013
0 Stimmen
10 Kommentare
David Goldsmith
am 14 Jan. 2013
Bearbeitet: David Goldsmith
am 14 Jan. 2013
Image Analyst
am 14 Jan. 2013
Bearbeitet: Image Analyst
am 14 Jan. 2013
The compile process will find any needed .m files but not other files such as DLLs, documentation, mat files, Excel workbooks, splash images, data files, etc.
Look into the license() command. For example:
% Check that user has the Image Processing Toolbox installed.
hasIPT = license('test', 'image_toolbox');
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User said No, so exit.
return;
end
end
It has various codes that tell you if you don't have the license or if you have a floating license but all copies of it are in use at the moment.
David Goldsmith
am 14 Jan. 2013
Bearbeitet: David Goldsmith
am 14 Jan. 2013
Image Analyst
am 14 Jan. 2013
That doesn't make sense. It should never complain about not finding an m-file. Did it make an "excluded files.log" file or something like that? What's in it? Also, please provide all of the stuff spewed out to the console window when you run your program. Open a console window and run it from the OS prompt if you have to (to get the error message to stay there and not vanish). Lastly, you can call the Mathworks and ask them.
David Goldsmith
am 15 Jan. 2013
Image Analyst
am 15 Jan. 2013
Sometimes you do have to include an m-file in the mcc line (I found out today) - when you are calling a DLL because you can't use the h file like you can in the development environment, you have to create a "prototype" file, which is an m-file and it won't get found unless you explicitly include it with the -a option of mcc. Anyway it sounds like you have that part solved.
For the remaining license check out issue. You aren't by chance running this on a multi-user system under a different account are you? Can you install the MCR and exe on your system and run it? Does it work fine there, and is it just on the target system where it complains about the license? Or does it make the same complaint on both systems?
David Goldsmith
am 15 Jan. 2013
Image Analyst
am 16 Jan. 2013
Bearbeitet: Image Analyst
am 16 Jan. 2013
I'm surprised that you would get that kind of error message. Usually you get a message something like "You need to have MCR version 7.13 installed" instead. I'm really puzzled sure why you didn't get that. But the MCR installed on the target machine must match that you used to compile it with. You can find the proper MCR on your computer in the C:\Program Files\MATLAB\R2012b\toolbox\compiler\deploy\win64 (or similar) folder. I believe all the current and past MCRs are also available on the Mathworks web site.
Walter Roberson
am 16 Jan. 2013
Only R2012a and R2012b MCRs are available for download, as far as I have heard.
David Goldsmith
am 16 Jan. 2013
Walter Roberson
am 15 Jan. 2013
Bearbeitet: Walter Roberson
am 15 Jan. 2013
0 Stimmen
A couple of possibilities:
Question: is your code changing directories? Is the MATLAB path what you expect when the problem occurs?
Walter Roberson
am 16 Jan. 2013
0 Stimmen
The MCR version absolutely must match the compiler version.
David Goldsmith
am 17 Jan. 2013
0 Stimmen
4 Kommentare
Image Analyst
am 17 Jan. 2013
How exactly did you tell the compiler to use the local or network version of the files? It goes through the search path to determine which dependent m-file(s) to use. Did you adjust the path?
David Goldsmith
am 17 Jan. 2013
Image Analyst
am 17 Jan. 2013
I'm not sure I trust that. Sure it may include that file on the the network disk, but when it comes time to actually call the function it will see two versions of it - the network one and the one in the same folder. Then it has to decide which one to call. So even though you included that file, it may not be the one it calls. I'd put in a message box to verify,
uiwait(msgbox('Calling network file'));
or
uiwait(helpdlg('Calling local file'));
Then see if the network one is actually the one being used. Anyway, the compiler is a very expensive toolbox. Make sure you get your money's worth and call tech support. Can you do that? Did you buy it within the last year or are current on your maintenance contract?
David Goldsmith
am 17 Jan. 2013
David Goldsmith
am 18 Jan. 2013
0 Stimmen
Kategorien
Mehr zu Install Products finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!