【问题标题】:compiler for Matlab function block R2011bMatlab 功能块 R2011b 的编译器
【发布时间】:2014-06-09 05:28:33
【问题描述】:

我正在尝试使用 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.

无论我选择什么编译器,我都会遇到同样的错误。我需要选择哪个编译器,还是有其他问题?

【问题讨论】:

  • 您需要做的一件事是让 MEX 定位您的有效编译器。选择否 (n) 将简单地列出 Windows 已知的每个可能的编译器。选择是 (y) 并告知我们实际安装了哪些编译器。
  • 说-在这台计算机上找不到支持的 SDK 或编译器。

标签: matlab compiler-construction mex


【解决方案1】:

通过检查您的 cmets,我们首先要求您选择 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) 不适合您,您可以尝试 90 天试用 Microsoft Visual Studio:http://www.visualstudio.com/
  3. 如果 (1) 不适合您,您可以购买 Microsoft Visual Studio - 使用 (2) 中的链接
  4. 使用 Microsoft Visual Studio Express(这是免费的)-http://www.visualstudio.com/en-us/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/en-us/download/details.aspx?id=8279

祝你好运!

【讨论】:

  • @Aditi 欢迎您。如果您启动并运行 MEX,请告诉我。当你有空的时候在这里留下评论。
猜你喜欢
  • 2015-06-21
  • 1970-01-01
  • 1970-01-01
  • 2013-07-01
  • 1970-01-01
  • 2015-01-19
  • 1970-01-01
  • 2012-12-05
  • 1970-01-01
相关资源
最近更新 更多