解决matlab202b找不到编译器的问题

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

解决Matlab2012b找不到编译器的问题+解决补丁!
matlab在关联编译器的时候,会出现找不到编译器的问题,原因是matlab要找windows sdk的mt.exe,找不到,必然报错. 因为vs2012在安装时,windows sdk的mt.exe位置变了,可能matlab还是按照老的路径找,肯定找不到(原来在windows sdks下面,现在在windows kits下面).
matlab在关联编译器的时候,会出现找不到编译器的问题,原因是matlab要找windows sdk的mt.exe,找不到报错的.因为vs2012在安装时,windows sdk的mt.exe位置变了,而matlab还是按照老的路径找,肯定找不到(原来在windows sdks下面,现在在windows kits下面).
如果你的环境是64位windows,并且vs2012装在默认目录下,matlab是64位版本,那么直接使用附件的文件,把他们添加到matlab/bin/win64下面的相关目录下即可,一个4个文件,放在2个目录.
如果你的vs目录不是默认的,或者是32位版本,或者vs版本不是2012,那么需要修改附件里面的相关目录的设置(其实就是cl.exe和mt.exe的目录位置),
我修改的方法是直接设置成目标目录(默认安装的位置),不是读注册表,这样简单,也无需修改注册表,以及建立什么目录链接(mklink).当然如果你的mt.exe目录不在Windows kits下,那需要修改附件的文件.
附件里有一个word文件,是我修改的标识,当做帮助来用.
使用方法,
1
1 把附件相关的4个文件添加到matlab/bin/win64下面的2个相关目录
2 在matlab里面运行mbuild -setup, 然后选y, 再选择2012的那个项目,再选y
3 这是应该成功了
4 mex -setup也是一样的.
有一个奇怪的情况,就是.stp文件必须直接修改,我在桌面修改,然后覆盖到matlab目录后,其实并没有覆盖,还是原来的文件. 修改时要注意.
大家从这下载解决补丁吧!
How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
官网解决方案:
Solution:
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:
1. 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)
2. 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.
3. Confirm that you are running MATLAB 7.10 (R2010a). You can check this using the About box available at Help->About MATLAB.
4. 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.
5. Set up MEX to use Visual C++ 2010 with the command:
mex –setup
Visual 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 for up-to-date information concerning supported compilers. Related Documents/Files:
具体操作方式:
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
Please choose your compiler for building MEX-files:
3
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files
(x86)\Microsoft Visual Studio 10.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Software Development Kit (SDK) 7.1
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
*************************************************************************** Warning: MEX-files generated using Microsoft Windows Software Development
Kit (SDK) require that Microsoft Visual Studio 2010 run-time
libraries be available on the computer they are run on.
If you plan to redistribute your MEX-files to other
MATLAB users, be sure that they have the run-time libraries.
***************************************************************************
Trying to update options file:
C:\Users\Administrator\AppData\Roaming\MathWorks\MATLAB\R2012b\mex opts.bat
From
template: C:\PROGRA~1\MATLAB\R2012b\bin\win64\mexopts\mssd
k71opts.bat
Done . . .
************************************************************************** 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:
Building with the -largeArrayDims option enables the new API.
**************************************************************************
5。

相关文档
最新文档