matlab r2014a 和vs产品交叉编译问题

先说下我的环境配置:

win 7 

matlab r2014a

visual studio 2010


在matlab的官网上有介绍matlab 用mex交叉编译支持的编译器。如下

http://www.mathworks.com/support/compilers/R2014a/



按照上面的介绍应该是matlab 默认支持vs2010的编译器的。但是我在r2014a中用mex -setup开启交叉编译功能时,一直只有如下图的编译器选项(microsoft windows SDK 7.1)。找不到vs2010的。

我在网上有找到解决matlab r2010a对vs2010的编译器支持问题的帖子。
http://www.mathworks.com/matlabcentral/answers/93013-how-can-i-use-microsoft-visual-c-2010-to-create-mex-files-with-matlab-7-10-r2010a

但是我试过下载他的mex包里的文件,但是这个解决不了matlab r2014a的问题。


最终解决方案是:

按照如下说明增添一个环境变量:VS100COMNTOOLS 

Running mex inverbose mode has identified the issue - I installed visual studio to anon-standard location (on my D: drive), but for some reason, the VS120COMNTOOLS environment variable was pointing to the 'C:\Program Files (x86)\MicrosoftVisual Studio 12.0\Common7\Tools\' directory. Quitting matlab and changing theenvironment variable to the correct location ('D:\Microsoft Visual Studio12.0\Common7\Tools\' in my case) fixed the issue.

 

源文档 <http://www.mathworks.com/matlabcentral/answers/120713-matlab-r2014a-and-visual-studio-professional-2013>

相应的VS2010vs2015的版本添加相应的环境变量。

C:\Softwares\MicrosoftVisual Studio 10.0\Common7\Tools

C:\Softwares\MicrosoftVisual Studio 14.0\Common7\Tools


成功后截图:



  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值