【Matlab】Matlab R2014a 64位与Visual Studio2015的mex相关问题
来源:互联网 发布:二叉树的结点算法 编辑:程序博客网 时间:2024/04/28 16:16
由于C语言的高效性,在matlab中会经常需要调用C语言的衍生程序,所以用到mex。但是mex -setup中,MatlabR2014a在官方给出的文档中,最高仅支持到VS2013。这让用VS2015和MatlabR2014a的我们会很头疼的一件事情。然而网上对这一方面的资料的好像比较少,通过google和各种百度,整理下面方法供大家参考一下
本文给出的方法仅仅面对MatlabR2014a 64位 与 Visual Studio2015,win10 环境
当mex -setup(注意存在空格)时,弹出:
Error using mex No supported compiler or SDK was found. For options,
visit http://www.mathworks.com/support/compilers/R2014a/win64.
那么打开下面网址则可看到:
打开相应版本的supported compilers的detail,选择下载下面的win sdk
当安装完SDK后,再在matlab中敲入 mex -setup,则会弹出warning,显示没有合适的compilers。(应该类似下图,当时我忘记截图了,囧)
>> mex -setup Warning: Windows SDK 7.1 appears to be installed, but its compiler was not found. Install .NET Framework 4.0, and then rerun the SDK installation to add the "Visual C++ Compilers" component. See http://www.mathworks.com/support/solutions/en/data/1-IB1G3Q/ for more information. Error using mex No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options, see http://www.mathworks.com/support/compilers/R2015b/win64.html.
这里好像是因为下载的win sdk7.1是.net Framework4的,而win10的版本应该在.NET Framework 4.6,所以在这里出现一点问题。
具体参考:
https://cn.mathworks.com/matlabcentral/answers/279692-why-does-microsoft-windows-sdk-7-1-not-get-detected-as-a-supported-compiler-for-windows-10-with-fram
当下载完上述网站给的链接后,matlab应该可以正常mex了
>> mex -setupMEX 配置为使用 'Microsoft Windows SDK 7.1 (C)' 以进行 C 语言编译。Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.要选择不同的语言,请从以下选项中选择一种命令: mex -setup C++ mex -setup FORTRAN
以上,欢迎大家继续补充
==============================================================
==============2017年3月6日更新==============================================================
有个好友也出现了这个问题,我也将其整理如下:
他的配置如下:MATLAB2016b VS2008 MinGW4.9.2 win7 64位
由于Matlab2016b并不支持VS2008,所以他已经下载好MinGW4.9.2
然而mex出现如下问题:
由于他已经安装好MinGW,所以本人感觉应该是SDK的问题。
于是他选择安装了SDK,链接如下:
https://www.microsoft.com/en-us/download/details.aspx?id=8279
于是便可以正常编译了,如下图:
**以上
欢迎大家指正补充**
- 【Matlab】Matlab R2014a 64位与Visual Studio2015的mex相关问题
- Matlab R2014a安装指南(64位win7)
- Matlab R2014a使用 mcc编译出错的问题
- 64位Mex文件在Matlab 2014b和Visual Studio 2013中的调试
- 64位Mex文件在Matlab 2014b和Visual Studio 2013中的调试
- matlab mex编译问题
- LINUX下MATLAB MEX编译的问题
- matlab 在使用mex编译的问题
- LINUX下MATLAB MEX编译的问题
- MATLAB之Matlab MEX找不到编译器的问题
- windows 10(64位)下实现vs20120C++调用matlab r2014a编写的m文件生成的.dll,.lib,.h文件
- Matlab R2014a libsvm-3.18的安装 总结
- MATLAB R2014a的安装及破解
- Matlab R2014a 安装教程
- matlab R2014a添加路径
- Matlab R2014a @newff函数
- matlab 调用mex -setup问题
- Matlab与C/C++, mex( Matlab executable)
- C++之虚函数(二)虚函数作用、使用方法详解
- 1001. A+B Format (20)
- ROS一些问题
- C++ 环形缓冲区RingBuffer 简单实现
- 中文乱码
- 【Matlab】Matlab R2014a 64位与Visual Studio2015的mex相关问题
- SlidingMenu 常用属性介绍
- 长链剖分随想
- linux中的task_struct结构体成员简要介绍
- WebGL学习系列-第一个程序
- 【Leetcode】292. Nim Game
- 卡尔曼滤波(Kalman Filter)
- 如何有效阅读caffe源码
- SpringMVC+Spring+Hibernate4框架整合