解决 matlab com The chosen compiler does not support building COM objects.

 
想在matlab7.0上编一个com,谁知在build时,出现错误:Error: The chosen compiler does not support building COM objects.  Matlab help提示mbuild –setup, 但是我用这个命令,却列出的编译器选项里,没有发现我机器上装的Microsoft Visual C++ 2005的选项。在网上搜一下,很多人问这个问题,没有个清楚的解释。 经常受益于网友们无私共享,原以此为略作滴水报答。
 其实仔细检查matlab的help, 就会发现原来 Matlab是从7.04版(R14SP2), 开始可以识别Microsoft Visual C++ 2005的编译器, 7.00版(R14)就不可以识别Microsoft Visual C++ 2005。如果要利用Microsoft Visual C++ 2005编译com,一定要下载7.04版以后的matlab。
 目前matlab的最新版可能是matlab2007b, 我下载了MATLAB Version 7.4.0.287 (R2007a), 安装此版本后运行mbuild –setup, 很顺利就可以找到Microsoft Visual C++ 2005编译器。
具体运行结果如下:
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:  
Would you like mbuild to locate installed compilers [y]/n? n
 Select a compiler:
[1] Borland C++ Compiler (free command line tools) 5.5
[2] Borland C++Builder 6.0
[3] Borland C++Builder 5.0
[4] Lcc-win32 C 2.4.1
[5] Microsoft Visual C++ 6.0
[6] Microsoft Visual C++ .NET 2003
[7] Microsoft Visual C++ 2005
[8] Microsoft Visual C++ 2005 Express Edition
 [0] None
 
Compiler: 7
 
Your machine has a Microsoft Visual C++ 2005 compiler located at
C:/Program Files/Microsoft Visual Studio 8. Do you want to use this compiler [y]/n? y
 
Please verify your choices:
 
Compiler: Microsoft Visual C++ 2005 
Location: C:/Program Files/Microsoft Visual Studio 8
 
Are these correct?([y]/n): y
 
****************************************************************************
 Warning: Applications/components generated using Microsoft Visual Studio   
           2005 require that the Microsoft Visual Studio 2005 run-time      
           libraries be available on the computer used for deployment.      
           To redistribute your applications/components, be sure that the   
           deployment machine has these run-time libraries. More information
           is at:                                                           
           http://www.mathworks.com/support/solutions/data/1-2223MW.html    
****************************************************************************
 
Trying to update options file: C:/Documents and Settings/sun/Application Data/MathWorks/MATLAB/R2007a/compopts.bat
From template:               D:/MATLAB~2/bin/win32/mbuildopts/msvc80compp.bat
 
Done . . .
 
 
--> "D:/MATLAB~2/bin/win32/mwregsvr D:/MATLAB~2/bin/win32/mwcomutil.dll"
 
DllRegisterServer in D:/MATLAB~2/bin/win32/mwcomutil.dll succeeded
 
--> "D:/MATLAB~2/bin/win32/mwregsvr D:/MATLAB~2/bin/win32/mwcommgr.dll"
 
DllRegisterServer in D:/MATLAB~2/bin/win32/mwcommgr.dll succeeded
 
找个好的下载源:本人推荐 ftp://down.toxb.com/-=OtherTools=-/-=Edu=-/Mathworks.Matlab.R2007a.DVD.ISO-TBE.exe  里面包含注册码,本人测试可用。
 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值