我正在尝试使用Deploytool在Matlab中创建一个Windows独立应用程序,为我的项目生成.exe文件 . (如此处所述:http://www.mathworks.co.uk/products/demos/compiler/deploytool/index.html) .
问题是在Deploytool中我添加我的文件并按下Build按钮它要求我使用mbuild -setup来设置我的编译器 . 当我这样做时,我得到的唯一选择是:
Would you like mbuild to locate installed compilers [y]/n? n
Select a compiler:
[1] Microsoft Visual C++ 2005 SP1
[2] Microsoft Visual C++ 2008 Express
[3] Microsoft Visual C++ 2008 SP1
[0] None
当我选择任何我得到这些:
*The default location for Microsoft Visual C++ 2008 Express compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0,
but that directory does not exist on this machine.
Please enter the location of your compiler:*
我构建时也遇到以下错误:
*Could not find the compiler "cl" on the DOS path.
Use mbuild -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Unable to locate compiler.
Error: An error occurred while shelling out to mbuild (error code = 2).
Unable to build executable.*
你能帮我解决一下这个问题 .
提前致谢 .
4 回答
您需要允许mbuild检测已安装的编译器 . Matlab编译器包含一个默认的C编译器 . 在我的Windows XP系统上,我得到:
我安装了两个版本的Visual Studio,但您可以看到默认编译器位于MATLAB安装目录中 .
当脚本要求找到已安装的编译器时,请确保回答“y”
您需要在计算机上安装编译器 . 您可以从此处下载Visual Studio Express:Visual Studio Express Download .
我在我的计算机上安装了Microsoft Visual Studio Ultimate . 当在mbuild设置中询问编译器的位置时,我将其重定向到
C:\Program Files (x86)\Microsoft Visual Studio 10.0
. 这对我有用 .并安装以下设置 - “MCRInstaller.exe”(此安装文件用于设置运行时编译器)安装后您可以使用“部署工具”各自的文件,如* .Project .
请享用...