我尝试在matlab中使用“deploytool”在matlab中为vba制作dll . 我的环境是Matlab R2013b和VS2013 .
我用bellow命令设置编译器
mbuild -setup
我将Visual Studio 2013作为编译器目录 . 但是,下面的消息使deploytool失败了 .
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.
我还检查了其他类似讨论中的lincese问题 . 使用!mcc和license('checkout','Compiler')
!mcc返回以下错误
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"..
但许可证('checkout','Compiler')给了我
ans = 1
我想出了matlab R2013b支持的一件事,直到Visual Studio 2012.从下面的url . http://kr.mathworks.com/support/compilers/R2013b/index.html?sec=win32
我应该在Matlab 2013中安装2012 VS以使用mcc吗?
或者还有其他方法可以解决这个问题吗?
类似的问题也没有得到正确的答案 .
Deploytool for MATLAB R2013b doesn't work, what has changed?
我将尝试以下方法
也许缺少编译器的许可证 .
matlab中的“mcc”命令不起作用 .
所以我将在下面说明
www.youtube.com/watch?v=PsKQ7loWZgU
它仍然无效
首先,matlab中的命令“mcc”不起作用所以,我再次尝试“mbuild -setup”,但它仍然提供相同的错误消息 .
这里的问题是,正如我在问题中已经提到的,Matlab 2013b与visual studio 2013无法比较 .
所以我在下面的网站上下载了SDK7和.net framework 4
https://msdn.microsoft.com/ko-kr/vstudio/aa496123
https://www.microsoft.com/en-us/download/confirmation.aspx?id=8442
但是在“mbuild -setup”中选择这些选项并没有得到解决
我也尝试下载另一个包
https://www.microsoft.com/ko-kr/download/details.aspx?id=40784
仍然都失败了
1 回答
这不是一个确切的答案,只是对这个问题有用的评论 .
我们可以做3件事来检查我们的matlab编译器许可证
我想如果我们可以通过那些检查,那么我们可以毫无问题地使用deploytool .
在我的情况下,激活许可证后,它给了我一个错误,比如,
所以我可能需要更新我的许可证才能解决此问题 .
我只是将Matlab 2013改为2014版 . 这一切都很好
另外,我认为错误的原因是许可证问题 .
在安装matlab 2014之后,我做了3件事来为vba制作dll
在matlab中
安装生成的文件 . 就我而言,它位于
C:\ Program Files \ MATLAB \ R2014a \ toolbox \ compiler \ deploy \ win32 \ MCRInstaller.exe
允许来自Excel安全中心的VBA中的宏
使用Matlab的deploytool创建VBA ADD IN