How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
来源:互联网 发布:java培训一般价格 编辑:程序博客网 时间:2024/05/21 06:18
标题
How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?1
如何在MATLAB2010a中使用VS2010编译器创建(编译)MEX文件
最近在学习有关MC-BCS-SPL的算法代码,其中遇到要对C文件2进行编译的问题,但是一直编译出错。实验室同学有讲是我使用的MATLAB2010a未能支持VS2010的编译器,寻找解决方法之际发现硬盘里的“VS2010MEXSupport.zip”文件,所以就在此翻译下MathWorks Support Team给出的解决方法。
翻译
原文
The Microsoft Visual C++ 2010 compiler is not supported on the released version of MATLAB 7.10 (R2010a), but support can be added by installing a patch. To install the patch:
Download the patch attached to this Solution. The patch includes files needed to support these combinations of MATLAB and Visual C++ 2010:
• Visual C++ 2010 Professional and 64-bit MATLAB 7.10 (R2010a)
• Visual C++ 2010 Professional and 32-bit MATLAB 7.10 (R2010a)
• Visual C++ 2010 Express (Windows SDK 7.1 also required) and 64-bit MATLAB 7.10 (R2010a)
• Visual C++ 2010 Express and 32-bit MATLAB 7.10 (R2010a)
Launch MATLAB 7.10 (R2010a). If running on Windows Vista or Windows 7 run as administrator by right-clicking on the MATLAB shortcut and choosing “Run As Administrator”. This permits modification of files in the MATLAB installation path.
Confirm that you are running MATLAB 7.10 (R2010a). You can check this using the About box available at Help->About MATLAB.
Unzip the contents of the patch into your MATLAB installation using the following command on the MATLAB command window:
unzip( path_to_zip_file, matlabroot);
This command will automatically unzipped the files in the correct folder and you do not have to worry about placing them in correct folder.
- Set up MEX to use Visual C++ 2010 with the command:
mex –setupVisual C++ 2010 should now be among the listed options.
Note that this patch will only work with MATLAB 7.10 (R2010a). Using this patch with any version of MATLAB is not supported.
Other MathWorks products such as Real-Time Workshop do not support Visual C++ 2010.
Refer to http://www.mathworks.com/support/compilers/R2010a/index.html for up-to-date information concerning supported compilers.
翻译
MATLAB7.10(R2010a)并不支持VS2010的编译器,但是可以通过安装一个补丁来完成支持。具体补丁安装方法如下:
- 从附上的地址下载补丁3。该补丁只针对下边版本的MATLAB及VS的结合才有效:
VS2010专业版+64bit MATLAB7.10(R2010a)
VS2010专业版+32bit MATLAB7.10(R2010a)
vs2010精简版(需要安装Windows SDK 7.1)+64bit MATLAB7.10(R2010a)
vs2010精简版(需要安装Windows SDK 7.1)+32bit MATLAB7.10(R2010a) - 运行MATLAB2010(R2010a)。无论是在Vista还是Win7系统上运行,都要以右键的管理员身份打开以确保第4步的修改可以允许进行。
- 确定版本是否为MATLAB2010(R2010a)。可以通过菜单栏的“Help->About MATLAB”来核实。
- 使用如下命令把补丁(该补丁应该在当前MATLAB的工作目录下)的内容解压到MATLAB的安装路径里:
unzip('VS2010MEXSuport.zip');
该命令会自动将补丁内容解压到MATLAB的安装路径里(而且会将32bit和64bit的同时解压进去,所以没有必要担心系统为32bit还是64bit),具体的解压路径如下:
D:\Program Files\MATLAB\R2010a\bin\win64\mexopts
D:\Program Files\MATLAB\R2010a\bin\win32\mexopts
- 使用如下命令设置MEX以使用VS2010
mex -setup
VS2010必须为上边所列版本。
需要注意的是该补丁只针对MATLAB2010(R2010a)版本有效。
其他类似MathWorks的Real-Time Workshop并不支持VS2010。
可以登录http://www.mathworks.com/support/compilers/R2010a/index.html获取有关编译器支持的实时信息。
说明
1.必须以管理员身份运行MATLAB
2.确保补丁在MATLAB的当前工作目录下
参考文献
- 原文地址 ↩
- MC-BCS-SPL源代码网址 ↩
- 补丁下载地址 ↩
- How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
- How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
- Can I use Java to create or manage XML files?
- How can I create ePub files from my books?
- How to create a DLL library in C and then use it with C#
- How do I create a MEX file
- how to use linux epoll with c
- How to create EPS files...
- How to build mex file directly in Visual Studio 2010?
- How To Use the Spreadsheet Web Component with Visual Basic
- How to automate Microsoft Excel from Microsoft Visual C#.NET
- How to Compile XviD with Microsoft Visual C++ 6.0
- How to Compile XviD with Microsoft Visual C++ 6.0(zhuan)
- How to Compile XviD with Microsoft Visual C++6.0
- How to Compile XviD with Microsoft Visual C++ 6.0(转)
- How to Build libiconv with Microsoft Visual Studio
- How to Build libiconv with Microsoft Visual Studio
- How to create a DLL with SWIG from Visual Studio 2010
- CSS中flexbox的使用技巧及相关的移动web布局优化
- 火车缓缓停下,又是一座全新的城市
- 云海飞翔lee -- UIAlertController
- 利用python批量下载美拍视频
- IOS编程教程(十三):如何往表视图(Table View)添加搜索栏(Search Bar)
- How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
- Debian系统自定义配置ip和eth0。
- 《Linux内核设计的艺术》总结:开机加电到main执行
- Chrome Explorer & 360极速浏览器 & Firefox
- 二叉树的非递归遍历
- 搭建嵌入式QT开发环境
- 如何开始acm之旅以及需要注意的事项
- scala 传值参数和传名参数 ():=>和:=>
- 数据库帮助类 MySqliteHelper