Executables from Matlab compiler fail to run on the computer where they were built, but run on other computers. How do I run executables created using the matlab compiler (mcc) in debug mode?

12 visualizzazioni (ultimi 30 giorni)
I use the matlab compiler, via the Deploy Tool, to build an executable for Win-7 64-bit using Matlab 2012a, and MATLAB Compiler Version 4.17.
The executables run on other Win-7 64-bit computers that have either Matlab or the MCR installed, but the executables DO NOT RUN on the computer where they were built.
These executables immediately cause an error, prior to showing any output in the command console. When the executable is run on this laptop where the exe was built, the console window appears, but nothing happens in the console, and then causes an error dialog to appear that says “MYFUN.exe” has stopped working. Windows is collecting more information about the problem.” The system creates three files in the \Users\name\AppData\Local\Temp directory, but these appear noninformative to me.
Also, I have recently successfully built executables using Matlab R2010b for this same system (laptop with Win7-64) and they continue to run with no errors on this system now.
What I would like to do is to run the executable in debug mode. However I cannot figure out how to do this. Does anyone know?
Alternatively, if you have encountered this problem and solved it, I would be very appreciative to know how you solved it, and not bother with the debug mode execution.
Thank you very much. George
  4 Commenti
raym
raym il 29 Mag 2017
Modificato: Walter Roberson il 26 Gen 2018
I have the same problem. When I run the binary from command window by :
!D:\QMDownload\CMDEntryExitSuperColoc\for_testing\CMDEntryExitSuperColoc.exe
then error details returned.
java.lang.IllegalStateException: ActionData AbstractNamedUniqueID object with unique ID 'close-genome-desktop' and user-visible name 'Exit NGS Browser'. is already registered.
at com.mathworks.mwswing.binding.KeyBindingManager.throwError(KeyBindingManager.java:623)
at com.mathworks.mwswing.binding.KeyBindingManager.addAction(KeyBindingManager.java:201)
at com.mathworks.mwswing.binding.KeyBindingManager.parseAndRegisterActions(KeyBindingManager.java:71)
at com.mathworks.services.binding.MatlabKeyBindings.addActionFile(MatlabKeyBindings.java:666)
at com.mathworks.services.binding.MatlabKeyBindings.readActionAndContextFilesFromOSGi(MatlabKeyBindings.java:639)
at com.mathworks.services.binding.MatlabKeyBindings.<clinit>(MatlabKeyBindings.java:592)
at com.mathworks.widgets.action.BaseAbstractAction.<init>(BaseAbstractAction.java:24)
at com.mathworks.widgets.action.AbstractNewAction.<init>(AbstractNewAction.java:24)
at com.mathworks.hg.peer.FiguresGroup$NewFigureAction.<init>(FiguresGroup.java:78)
at com.mathworks.hg.peer.FiguresGroup.createToolBar(FiguresGroup.java:68)
at com.mathworks.hg.peer.FiguresGroup.<init>(FiguresGroup.java:43)
at com.mathworks.hg.peer.FiguresGroup.getInstance(FiguresGroup.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mathworks.widgets.desk.DTGroup.createPropertyProvider(DTGroup.java:253)
at com.mathworks.widgets.desk.DTGroup.getPropertyProvider(DTGroup.java:190)
at com.mathworks.widgets.desk.DTOccupant.getProperty(DTOccupant.java:748)
at com.mathworks.widgets.desk.DTOccupant.getToolstripTabs(DTOccupant.java:520)
at com.mathworks.widgets.desk.DTGroup.add(DTGroup.java:345)
at com.mathworks.widgets.desk.Desktop.addClient(Desktop.java:6569)
at com.mathworks.widgets.desk.Desktop.addClient(Desktop.java:6536)
at com.mathworks.widgets.desk.Desktop.addSingletons(Desktop.java:5603)
at com.mathworks.mde.desk.MLDesktop.<init>(MLDesktop.java:554)
at com.mathworks.mde.desk.MLDesktop.getInstance(MLDesktop.java:615)
at com.mathworks.mde.desk.MLDesktopRegistrar.getDesktop(MLDesktopRegistrar.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mathworks.mlservices.MLServices.getRegisteredService(MLServices.java:29)
at com.mathworks.mlservices.MatlabDesktopServices.<clinit>(MatlabDesktopServices.java:14)
at com.mathworks.hg.peer.FigureClientProxy.getMatlabDesktop(FigureClientProxy.java:504)
at com.mathworks.hg.peer.FigureClientProxy.<init>(FigureClientProxy.java:92)
at com.mathworks.hg.peer.HG2FigureClientProxy.<init>(HG2FigureClientProxy.java:20)
at com.mathworks.hg.peer.FigureHG2Mediator.<init>(FigureHG2Mediator.java:43)
at com.mathworks.hg.peer.HG2FigurePeer.createFigureClient(HG2FigurePeer.java:74)
at com.mathworks.hg.peer.FigurePeer.doInitializePeer(FigurePeer.java:454)
at com.mathworks.hg.peer.FigurePeer$2.run(FigurePeer.java:419)
at com.mathworks.jmi.AWTUtilities$Invoker$5$1.run(AWTUtilities.java:591)
at com.mathworks.mvm.context.ThreadContext$1.call(ThreadContext.java:76)
at com.mathworks.mvm.context.ThreadContext.callWithContext(ThreadContext.java:105)
at com.mathworks.mvm.context.ThreadContext.runWithContext(ThreadContext.java:73)
at com.mathworks.mvm.context.MvmContext.runWithContext(MvmContext.java:107)
at com.mathworks.jmi.AWTUtilities$Invoker$5.runWithOutput(AWTUtilities.java:588)
at com.mathworks.jmi.AWTUtilities$Invoker$2.watchedRun(AWTUtilities.java:475)
at com.mathworks.jmi.AWTUtilities$WatchedRunnable.run(AWTUtilities.java:436)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Warning: Unable to create com.mathworks.hg.peer.FiguresGroup, for details see
C:\Users\rmd\AppData\Local\Temp\MATLABDesktopCreateError.log

Accedi per commentare.

Risposta accettata

George
George il 25 Ott 2012
Modificato: George il 26 Ott 2012
I have solved this problem by a new installation of Matlab. I installed R2012b and the compiled standalone program works on this computer.
I believe that reinstalling R2012a would also have solved this.
I think that the problem may have originated from trying to install the Win SDK and Visual C++ compilers for Win 7 after having R2012a installed. Also, I encountered complications with installing the Win SDK and Vis C++ compilers required for the Matlab compiler toolbox with R2012, since it no longer works with Vis C++ express versions. Perhaps the multiple attempts to get a good installation of the SDK and compilers broke a critical link with Matlab R2012a. What I had to do was detailed by a post on a microsoft support page: "In order to install the x64 compilers from the Windows 7 SDK after installing Visual Studio 2010 Service Pack 1, you'll need to install the Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1. The update is available from here: http://go.microsoft.com/fwlink/?LinkID=212355
When you install the Windows SDK, make sure to clear the "Visual C++ Compilers" checkbox, and install the SDK. Once the SDK is installed, install the compiler update to install the x64 compilers."
Perhaps doing the install of the SDK compilers as described prior to installing Matlab is key.
  3 Commenti
George
George il 25 Ott 2012
Modificato: George il 25 Ott 2012
I thank you and Image Analyst for your attention and consideration. Today I verified that the standalone generated from a reinstalled R2012a did work. The problem may have been an unintentional deletion/uninstall of Vis C++ 2008 redistributable, or perhaps a broken link to that component. It all seems functional now. I am not certain that was the cause of the failure, and one thing is still unclear: I could not tell which vis c redistibutable was required by the built app, based on results from dependency walker.
George
George il 25 Ott 2012
By the way, Mathworks support team said that it is not currently possible to run the executables created in debug mode; also, that usually you should see the errors generated by running the program from the Windows DOS Command Prompt. However, in my case this was not informative as the program was crashing prior to anything being written to the console window.

Accedi per commentare.

Più risposte (2)

Kaustubha Govind
Kaustubha Govind il 24 Ott 2012
George: If your application is working from within MATLAB, but not outside of it, most likely it cannot find MATLAB run-time libraries on the System path. Please see MCR Path Settings for Development and Testing.
  1 Commento
George
George il 24 Ott 2012
My path does include matlabroot\runtime\win64
For example: PATH=...C:\Program Files (x86)\MATLAB \R2012a_32bit\runtime\win32;C:\Program Files (x86)\MATLAB\R2012a_32bit\bin;C:\Program Files\MATLAB\R2012a\runtime\win64; C:\Program Files\MATLAB\R2012a\bin;C:\Program Files\MATLAB\R2010b\runtime\win64;C:\Program Files\MATLAB\R2010b\bin;
And, the contents of C:\Program Files\MATLAB\R2012a\runtime\win64 are two files, MemShieldStarter.exe, and mclmcrrt7_17.dll, which seems normal; yet the standalone still does not run.

Accedi per commentare.


Image Analyst
Image Analyst il 24 Ott 2012
and are you sure you installed the MCR on your computer? It's not enough just to have the installer for it in your compiler toolbox.
  2 Commenti
George
George il 24 Ott 2012
Modificato: George il 25 Ott 2012
I did install the MCR on this computer after encountering this problem, but it did not help. Besides, the MCR is not required if Matlab is installed, as I understand it.
I have looked at the matlab wiki page that you mentioned, and will try to examine the dependencies closely.
Thank you.

Accedi per commentare.

Categorie

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

Community Treasure Hunt

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

Start Hunting!

Translated by