0

I try to make dll for vba in matlab using "deploytool" in matlab. My environments are Matlab R2013b and VS2013.

I used bellow command to set the compiler

mbuild -setup

And I put the Visual studio 2013 as a compiler directory. But deploytool is failed with below messages.

ant:
<ant>
  <mkdir dir="C:\Program Files\MATLAB\R2013b\work\mymagic\for_redistribution" />
  <mkdir dir="C:\Program Files\MATLAB\R2013b\work\mymagic\for_testing" />

mcc -W 'excel:mymagic,Class1,1.0' -T link:lib -b -d 'C:\Program       
Files\MATLAB\R2013b\work\mymagic\for_testing' -v 'C:\Program    
Files\MATLAB\R2013b\work\mymagic.m' 'class{Class1:C:\Program
Files\MATLAB\R2013b\work\mymagic.m}' 

Test checkout of feature 'Compiler' failed.

mcc failed.

Also I checked lincese issues from other similar discussions. Using !mcc and license('checkout','Compiler')

!mcc returns below error

Error: Could not check out a Compiler license: 
Cannot find license file. 
 The license files (or license server system network addresses) attempted are  
listed below.  Use LM_LICENSE_FILE to use a different license file, 
 or contact your software provider for a license file. 
Feature:       Compiler 
Filename:      C:\Program Files\MATLAB\R2013b\licenses 
License path:      C:\Users\****1505\AppData\Roaming\MathWorks\MATLAB\R2013b_licenses;C:\Program Files\MATLAB\R2013b\licenses\license.dat;C:\Program Files\MATLAB\R2013b\licenses; 
FLEXnet Licensing error:-1,359.  System Error: 2 "No such file or directory" 
For further information, refer to the FLEXnet Licensing documentation, 
available at "www.flexerasoftware.com".. 

But license('checkout','Compiler') gives me

ans = 1

I figure out one thing that matlab R2013b supports until Visual Studio 2012. From below url. http://kr.mathworks.com/support/compilers/R2013b/index.html?sec=win32

Should I install 2012 VS to use mcc in Matlab 2013 ?

Or is there any other methods to solve this problem ?

The similar question also doesn't get the proper answer.

Deploytool for MATLAB R2013b doesn't work, what has changed?


I will try below methods

http://de.mathworks.com/matlabcentral/answers/121413-error-using-mcc-test-checkout-of-feature-compiler-failed

Maybe the license for compiler is missing.

"mcc" command in matlab doesn't work.

So I will follow below

www.youtube.com/watch?v=PsKQ7loWZgU


Still it doesn't work

Firstly, the command "mcc" in matlab does't work So, I try "mbuild -setup" again but it still gives same error messages.

The problem here was that, as I already mentioned in the question, Matlab 2013b doesn't comparable with the visual studio 2013.

So I downloaded SDK7 and .net framework 4 in below site

https://msdn.microsoft.com/ko-kr/vstudio/aa496123

https://www.microsoft.com/en-us/download/confirmation.aspx?id=8442

But choosing those options in "mbuild -setup" doesn't be resolved

I also try to download another package

https://www.microsoft.com/ko-kr/download/details.aspx?id=40784

still all failed

Community
  • 1
  • 1
JonghoKim
  • 1,965
  • 7
  • 21
  • 44

1 Answers1

0

This is not an exact answer, just useful comments for this problem.

We can do 3 things to check our license for matlab compiler

license('checkout','Compiler')
!mcc
mcc

I think if we can pass those checking than we can use deploytool without any problems.

In my case, after activation of license it gives me an error, like,

Error: Could not check out a Compiler license: 
SIGN= keyword required but missing from the license certificate. 
 This is probably because the license is older than the application 
 You need to obtain a SIGN= version of this license from your vendor. 
Feature:       Compiler 
Missing:       SIGN1= 
License path:      C:\Users\****1505\AppData\Roaming\MathWorks\MATLAB\R2013b_licenses;C:\Program Files\MATLAB\R2013b\licenses\license.dat;C:\Program Files\MATLAB\R2013b\licenses\license_****1505-PC_874166_R2013b.lic; 
FLEXnet Licensing error:-114,582 
For further information, refer to the FLEXnet Licensing documentation, 
available at "www.flexerasoftware.com"..

So I might need to update my license to resolve this problem.


I simply change Matlab 2013 to 2014 version. It makes all fine

Also, I believe the reason for error was license issues.


After installing matlab 2014 I did below 3 things to make dll for vba

  1. install MATLAB MCR command

mcrinstaller

in matlab

install the generated file. In my case it was located in

C:\Program Files\MATLAB\R2014a\toolbox\compiler\deploy\win32\MCRInstaller.exe

  1. allow macros in VBA from security center of Excel

  2. Create VBA ADD IN using deploytool of Matlab

JonghoKim
  • 1,965
  • 7
  • 21
  • 44