Matlab R2017b 编译C、C++程序的编译器配置

Matlab跑代码时,有的代码含有Matlab、C或C++混合编程,需要在Matlab中配置C、C++编译器,我自己的电脑系统中装的是Matlab R2017b和Visual Studio 2015,以这个为例,在Matlab中配置VS2015编译器。

注意:一定要记住,Visual Studio 2015要先安装,然后在安装Matlab R2017b,否则不行。

1、首先安装Visual Studio 2015(等待的时间较长);

2、Visual Studio 2015安装成功后,在安装Matlab R2017b;

3、Matlab R2017b安装成功后,打开Matlab R2017b,在“命令行窗口” 输入:mex -setup ——>回车;

4、选中“mex -setup C++”,出现下图,表示编译器已配置成功;

      以上是,当然使用 MinGW -w64 也可以配置 C/C++ MEX 文件配置编译器,

http://ww2.mathworks.cn/help/matlab/matlab_external/compiling-c-mex-files-with-mingw.html?.mathworks.com                 

不过,有的代码必须使用Visual Studio 中C++编译器,建议使用Visual Studio 的编译器。

猜你喜欢

转载自blog.csdn.net/zaishuiyifangxym/article/details/81669673
今日推荐