Matlab功能块R2011b的编译器

莫乔·乔乔(Mojo Jojo)

我正在尝试在R2011b中使用MATLAB Function模块。当我尝试运行程序时,这是我得到的错误:

无法找到Stateflow和MATLAB Function模块所需的C编译器。

使用'mex -setup'选择一个受支持的C编译器。

当我尝试做时mex -setup,我得到以下输出:

>> mex -setup
 
Welcome to mex -setup.  This utility will help you set up  
a default compiler.  For a list of supported compilers, see  
http://www.mathworks.com/support/compilers/R2011b/win64.html 
 
Please choose your compiler for building MEX-files: 
 
Would you like mex to locate installed compilers [y]/n? n
 
Select a compiler: 
[1] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker) 
[2] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker) 
[3] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
[4] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker) 
[5] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker) 
[6] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker) 
[7] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
[8] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker) 
[9] Microsoft Software Development Kit (SDK) 7.1 
[10] Microsoft Visual C++ 2005 SP1 
[11] Microsoft Visual C++ 2008 SP1 
[12] Microsoft Visual C++ 2010 
[13] Microsoft Visual C++ 2010 Express 
 
[0] None 
 
Compiler: 1
 
Warning: The default location for Intel C++ compiler is: 
         "C:\Program Files (x86)\Intel\ComposerXE-2011" 
         but either that directory does not exist or the configuration 
         is invalid. 
 
Use C:\Program Files (x86)\Intel\ComposerXE-2011 anyway [y]/n? y
 
Please verify your choices: 
 
Compiler: Intel C++ 12.0 
Location: C:\Program Files (x86)\Intel\ComposerXE-2011 
 
Are these correct [y]/n? y
 
Error: Microsoft Visual Studio 2008 SP1 Professional Edition was not found 
       by mex -setup. 
       The Microsoft Visual Studio 2008 SP1 Professional Edition linker is 
       required to build Intel C++ MEX-files.  Please make sure that 
       Microsoft Visual Studio 2008 SP1 Professional Edition is installed 
       properly. 
 
 
Error using mex (line 206)
Unable to complete successfully.

无论选择哪种编译器,都会出现相同的错误。我需要选择哪个编译器,还是有其他问题?

雷瑞恩

通过检查您的评论,我们首先要求您选择yes选项,以查看您的计算机是否安装了任何有效的编译器。您选择了它,它无法找到任何有效的编译器。因此,您的计算机上没有安装任何编译器。

通常,如果要在Windows中编译MEX文件,则需要Microsoft Visual Studio编译器才能执行此操作。为此,我将根据您的可用状况为您提供四种解决方案:

  1. 如果您是大专院校的学生,请尝试访问Microsoft DreamSpark:https ://www.dreamspark.com/Product/Product.aspx ? productid = 72 & cmpid = W_VS_DSV_DS_728x90_ENG 您的机构可能与Microsoft达成了协议,您将可以免费下载Microsoft Visual Studio。就像您如何使用MATLAB R2011一样,最多支持Visual Studio 2010。因此,请确保选择2010作为版本。
  2. 如果情况(1)对您不利,您可以尝试Microsoft Visual Studio的90天试用版:http : //www.visualstudio.com/
  3. 您可以购买Microsoft Visual Studio,以防万一(1)无法为您提供帮助-请使用(2)中的链接
  4. 使用Microsoft Visual Studio Express(免费-http://www.visualstudio.com/zh-cn/downloads/download-visual-studio-vs#DownloadFamilies_4确保选择Visual C ++ 2010 Express这实际上是Microsoft Visual Studio的精简版本。我不确定此发行版中提供了哪些功能,但是存在完整版本的Microsoft Visual Studio所具有的大多数功能。我确实知道这与MATLAB R2011完全兼容,因此您可以毫无疑问地运行它。我怀疑您可能会使用这种方法,这完全没问题。需要下载Windows SDK:http : //www.microsoft.com/zh-cn/download/details.aspx?id=8279

祝你好运!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章