本文介绍了设置mex以使用Visual Studio 2010编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我安装了Visual Studio 2010。但是,MATLAB找不到编译器。
I have Visual Studio 2010 installed. However, MATLAB doesn't find the compiler.
>> mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[0] None
Compiler:
如果我回答 n
问题,我得到以下
If I answer n
to the question, I get the following
Would you like mex to locate installed compilers [y]/n? n
Select a compiler:
[1] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker)
[2] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker)
[3] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker)
[4] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker)
[5] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker)
[6] Microsoft Visual C++ 2005 SP1
[7] Microsoft Visual C++ 2008 Express
[8] Microsoft Visual C++ 2008 SP1
[0] None
Compiler: 8
The default location for Microsoft Visual C++ 2008 SP1 compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0,
but that directory does not exist on this machine.
Use C:\Program Files (x86)\Microsoft Visual Studio 9.0 anyway [y]/n? n
Please enter the location of your compiler: [C:\Program Files (x86)\Microsoft Visual Studio 9.0]
编译我的c ++代码以使其在MATLAB中可用的最简单的方法是什么?安装Visual C ++ 2008? oO
What is the easiest way to compile my c++ code to make it available in MATLAB? Install Visual C++ 2008? oO
推荐答案
这取决于你使用的MATLAB版本。 R2010b支持VS2010开箱。如果你有R2010a,有补丁可用:
It depends on what MATLAB version you are using. R2010b supports VS2010 out of the box. If you have R2010a, there is a patch available:
- Update From the World of MEX: Visual Studio 2010 Support
- How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
这篇关于设置mex以使用Visual Studio 2010编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!