网上一大片此类文章,这里主要说下matlab(R2012a)或者2012b版本中还没有兼容VS2012,因此提供以下几个配置文件。以解决在通过matlab提供的编译生成dll时的工具会不兼容VS2012的问题。只需要加入以下几个配置文件即可。
In Matlab 2012b (x64), command “mex -setup” will not find the compiler of vs2012, because the 2012b version of Matlab was released before the 2012 version of visual studio. To repair this problem, 4 files need added into Matlab install folders:
- Add
into folder
..\MATLAB\R2012b\bin\win64\mexopts\
- Add
into folder
..\MATLAB\R2012b\bin\win64\mbuildopts\
(Note: the above 4 files are for 64-bit version of Matlab)
根据自己的安装环境修改下bat文件里面的相关路径(path,include,lib),若上面链接失效,这里提供一份本地备份的可以在这里下载:matlab2012_vs2012