您的位置:首页 > 编程语言 > MATLAB

matlab2013b调用cpp文件,mex,VS2013配置问题

2016-01-04 21:58 471 查看
我用的版本分别是matlab2013b, VS2013

运行matlab函数的时候需要调用cpp文件,配置mex没有VS2013的选项,所以一直没有配置成功,在网上找了好久,终于找到了,在此记录一下。

准备工作:

1、需要下载一个文件,上传到百度云盘了,链接如下:

http://yun.baidu.com/share/link?shareid=104431454&uk=3511863638

2、下载之后将文件解压到matlab的安装路径中,我的是D:\matlab2013bInstall\bin\win32\mexopts\

下面对matlab进行操作:

1、输入命令:mex -setup

2、会提示你:

Please choose your compiler for building MEX-files:

Would you like mex to locate installed compilers [y]/n?

输入n并回车

3、这时候下边的选项里就会出现Microsoft Visual C++ 2013了:

Select a compiler:

[1] Intel C++ 13.0 (with Microsoft Software Development Kit (SDK) linker)

[2] Intel C++ 13.0 (with Microsoft Visual C++ 2010 linker)

[3] Intel C++ 13.0 (with Microsoft Visual C++ 2012 linker)

[4] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker)

[5] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker)

[6] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker)

[7] Intel Visual Fortran 13 (with Microsoft Software Development Kit (SDK) linker)

[8] Intel Visual Fortran 13.0 (with Microsoft Visual C++ 2010 linker)

[9] Intel Visual Fortran 13.0 (with Microsoft Visual C++ 2012 linker)

[10] Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker)

[11] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker)

[12] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker)

[13] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker)

[14] Lcc-win32 C 2.4.1

[15] Microsoft Software Development Kit (SDK) 7.1

[16] Microsoft Visual C++ 2005 SP1

[17] Microsoft Visual C++ 2008 SP1

[18] Microsoft Visual C++ 2010

[19] Microsoft Visual C++ 2012

[20] Microsoft Visual C++ 2013

[0] None

Compiler:

输入20并回车

4、又提示:

Your machine has a Microsoft Visual C++ 2013 compiler located at

D:\VS2013Install. Do you want to use this compiler [y]/n?

如果这个时候前面的文件路径是你的VS2013安装路径就输入y,如果不是就输入n,然后在接下来的提示信息后面输出正确的VS2013安装路径并回车。

5、接下来又会提示:

Are these correct [y]/n?

输入y并回车

OK!配置成功!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: