How to create a dll with Matlab Compiler?

조회 수: 5 (최근 30일)
Loic Wilfried Biakeu Njia
Loic Wilfried Biakeu Njia 2017년 6월 26일
댓글: Loic Wilfried Biakeu Njia 2017년 6월 28일
Hi.
I am a new user of Matlab compiler and I would like to create a c++ shared library using library compiler. After exporting my main function in "Library compiler", I am not able to click on "Package" (the "package" button never turns green and is not active). Note that with the same code or main function I was able to create a standalone apps with Application compiler. Please what could be the problem?
Besides when I open the "Library compiler" I have the following messages:
% code
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: This collection does not allow clients with duplicate names
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:93)
at com.mathworks.desktop.client.UniqueClientCollection.check(UniqueClientCollection.java:53)
at com.mathworks.desktop.client.UniqueClientCollection.add(UniqueClientCollection.java:47)
at com.mathworks.toolbox.compiler.desktop.DeploytoolToolstripTab.initializeToolstrip(DeploytoolToolstripTab.java:55)
at com.mathworks.toolbox.compiler.desktop.DeploytoolToolstripClient.loadingFinished(DeploytoolToolstripClient.java:149)
at com.mathworks.project.impl.ProjectGUI$3$1.run(ProjectGUI.java:380)
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)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection$1.stateChanged(AbstractDeploytoolFilesetToolstripSection.java:36)
at com.mathworks.deployment.desktop.toolstrip.AbstractFilesetToolstripSection.fireChangeListeners(AbstractFilesetToolstripSection.java:67)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.access$101(AbstractDeploytoolFilesetToolstripSection.java:14)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection$2.run(AbstractDeploytoolFilesetToolstripSection.java:49)
at com.mathworks.mwswing.MJUtilities.runOnEventDispatchThread(MJUtilities.java:911)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.fireChangeListeners(AbstractDeploytoolFilesetToolstripSection.java:46)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.updateUIWithCurrentData(AbstractDeploytoolFilesetToolstripSection.java:62)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection.updateUIWithCurrentData(ExportedFunctionsToolstripSection.java:250)
at com.mathworks.deployment.model.AbstractUIFilesetImplementation.fireDataChangedUIListeners(AbstractUIFilesetImplementation.java:178)
at com.mathworks.deployment.model.AbstractUIFilesetImplementation.addUserInput(AbstractUIFilesetImplementation.java:136)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection$6.run(ExportedFunctionsToolstripSection.java:275)
at com.mathworks.mwswing.MJUtilities.runOnEventDispatchThread(MJUtilities.java:911)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection.addFilesThroughUI(ExportedFunctionsToolstripSection.java:268)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection$1.actionPerformed(ExportedFunctionsToolstripSection.java:84)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleasedImpl(RegularButtonUI.java:328)
at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleased(RegularButtonUI.java:322)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:348)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.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)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection$1.stateChanged(AbstractDeploytoolFilesetToolstripSection.java:36)
at com.mathworks.deployment.desktop.toolstrip.AbstractFilesetToolstripSection.fireChangeListeners(AbstractFilesetToolstripSection.java:67)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.access$101(AbstractDeploytoolFilesetToolstripSection.java:14)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection$2.run(AbstractDeploytoolFilesetToolstripSection.java:49)
at com.mathworks.mwswing.MJUtilities.runOnEventDispatchThread(MJUtilities.java:911)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.fireChangeListeners(AbstractDeploytoolFilesetToolstripSection.java:46)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.updateUIWithCurrentData(AbstractDeploytoolFilesetToolstripSection.java:62)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection.updateUIWithCurrentData(ExportedFunctionsToolstripSection.java:250)
at com.mathworks.deployment.model.AbstractUIFilesetImplementation.fireDataChangedUIListeners(AbstractUIFilesetImplementation.java:178)
at com.mathworks.deployment.model.AbstractUIFilesetImplementation.addUserInput(AbstractUIFilesetImplementation.java:136)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection$6.run(ExportedFunctionsToolstripSection.java:275)
at com.mathworks.mwswing.MJUtilities.runOnEventDispatchThread(MJUtilities.java:911)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection.addFilesThroughUI(ExportedFunctionsToolstripSection.java:268)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection$1.actionPerformed(ExportedFunctionsToolstripSection.java:84)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleasedImpl(RegularButtonUI.java:328)
at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleased(RegularButtonUI.java:322)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:348)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.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)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection$1.stateChanged(AbstractDeploytoolFilesetToolstripSection.java:36)
at com.mathworks.deployment.desktop.toolstrip.AbstractFilesetToolstripSection.fireChangeListeners(AbstractFilesetToolstripSection.java:67)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.access$101(AbstractDeploytoolFilesetToolstripSection.java:14)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection$2.run(AbstractDeploytoolFilesetToolstripSection.java:49)
at com.mathworks.mwswing.MJUtilities.runOnEventDispatchThread(MJUtilities.java:911)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.fireChangeListeners(AbstractDeploytoolFilesetToolstripSection.java:46)
at com.mathworks.toolbox.compiler.desktop.toolstrip.AbstractDeploytoolFilesetToolstripSection.updateUIWithCurrentData(AbstractDeploytoolFilesetToolstripSection.java:62)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection.updateUIWithCurrentData(ExportedFunctionsToolstripSection.java:250)
at com.mathworks.deployment.model.AbstractUIFilesetImplementation.fireDataChangedUIListeners(AbstractUIFilesetImplementation.java:178)
at com.mathworks.deployment.model.AbstractUIFilesetImplementation.addUserInput(AbstractUIFilesetImplementation.java:136)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection$6.run(ExportedFunctionsToolstripSection.java:275)
at com.mathworks.mwswing.MJUtilities.runOnEventDispatchThread(MJUtilities.java:911)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection.addFilesThroughUI(ExportedFunctionsToolstripSection.java:268)
at com.mathworks.toolbox.compiler.desktop.toolstrip.ExportedFunctionsToolstripSection$1.actionPerformed(ExportedFunctionsToolstripSection.java:84)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleasedImpl(RegularButtonUI.java:328)
at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleased(RegularButtonUI.java:322)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:348)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.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)
Does it have a link to the difficulty I have to create the a .dll?
Thank you for your answers, Loic
  댓글 수: 2
Walter Roberson
Walter Roberson 2017년 6월 26일
You refer to creating a DLL with "MATLAB Compiler", but your tags say "MATLAB Compiler SDK". MATLAB Compiler SDK is the product you need to create a DLL since roughly the R2012b time frame (I would have to check the exact release); the facility used to be part of MATLAB Compiler but was moved to MATLAB Compiler SDK.
Loic Wilfried Biakeu Njia
Loic Wilfried Biakeu Njia 2017년 6월 28일
It was a wording mistake, sorry. I indeed used Matlab Compiler SDK to create a DLL. I don't know for which reason I had those messages but now it is find. May be because I started first to build a standalone application, and then right after for the same script I tried to build the dll without closing the previous project (even if I changed the App from compiler to compiler sdk).
Anyway, thank you for the answer.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by