声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2774|回复: 10

[混合编程] [求助]求教com组件问题

[复制链接]
发表于 2006-3-24 21:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
<P>我在matlab下做COM组件时遇到了些问题,想请各位高手指教!<br>我使用的是MATLAB 7.1<br>我的M文件中的代码是:<br>    function y=myadd(a,b)<br>y=a+b;<br><br>我在MATLAB Builder下编译先出现了以下的对话框:<br>Error Dialog<br><br>Improper index matrix reference<br><br>然后在Build Status中出现了下面的错误内容:<br>Building COM object...<br>mcc -M -silentsetup -d 'C:/Program Files/MATLAB71/work/testmyadd/src'  -B 'ccom:testmyadd,testmyadd,1.0'    'C:/Program Files/MATLAB71/work/testmyadd/myadd.m'   <br>include <br>fatal error C1083: Cannot open source file: 'Files/MATLAB71/extern/include': No such file or directory <br>mwcomtypes.idl <br><br>  C:/PROGRAM FILES/MATLAB71/BIN/WIN32//../MEX.PL: Error: IDL compile of 'mwcomtypes.idl' failed. <br><br>Creating distrib directory.<br>Moving files to distrib.<br><br>请问这是什么原因,我应怎么修改啊?</P>
[此贴子已经被cdwxg于2006-6-3 0:47:08编辑过]

回复
分享到:

使用道具 举报

发表于 2006-3-25 08:34 | 显示全部楼层

回复:(afly)求教com组件问题

你的matlab是不是没有装在根目录下?<BR><BR>下面是mathwork的解释<BR><BR><STRONG>Solution Number: 1-14KC3U</STRONG>
<P>Date Last Modified: 19 Apr 2005 Product: MATLAB(r);MATLAB(r) Compiler;MATLAB(r) Builder for Excel;MATLAB(r) Builder for COM Reported in Release: R14SP2 Fixed in Release: Platform: Windows Operating System: Windows Any</P>
<br><STRONG>Subject:</STRONG>
<P>Why do I receive errors when compiling with MCC in MATLAB 7.0.4 (R14SP2)? </P>Problem Descriptions
<P>When I try to use the MATLAB Builder for COM or MATLAB Builder for Excel with the Microsoft Visual C++ Compiler 6.0, I receive the error<BR><BR>include <BR>fatal error C1083: Cannot open source file: 'Files/MATLAB704/extern/include': No such file or directory <BR>mwcomtypes.idl <BR>Processing D:/Program Files/MATLAB704/extern/include/mwcomtypes.idl <BR>midl : command line error MIDL1003 : error returned by the C preprocessor (2) <BR><BR>D:/PROGRAM FILES/MATLAB704/BIN/WIN32//../WIN32/MEX.PL: Error: IDL compile of 'mwcomtypes.idl' failed. <BR>When I try to package a COM object using the MATLAB Builder for COM or MATLAB Builder for Excel with Microsoft Visual Studio .NET, an error dialog comes up with the error:<BR><BR>The system cannot find the file specified<BR></P>
<P><STRONG>Solution:</STRONG>
<P>These errors occur because MATLAB 7.0.4 (R14SP2) is installed in a directory containing spaces in the directory name. <BR>To work around this issue, reinstall MATLAB into a directory that does not contain any spaces</P>

评分

1

查看全部评分

 楼主| 发表于 2006-3-28 13:01 | 显示全部楼层
谢谢happy!但我还是不太明白,我的MATLAB7.1是在按默认路径装的(c:\program files\)。
<P>These errors occur because MATLAB 7.0.4 (R14SP2) is installed <FONT color=#dd226d>in a directory containing spaces in the directory name. <BR></FONT>To work around this issue, reinstall MATLAB into <FONT color=#d52b4d>a directory that does not contain any spaces<BR></FONT><FONT color=#000000>我色部分我有些不懂,麻烦您具体指教一下!谢谢!</FONT></P>
发表于 2006-3-28 15:09 | 显示全部楼层

回复:(afly)求教com组件问题

<P>This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds: <br><br>To work around this issue, reinstall MATLAB into a directory that does not contain any spaces. For example, instead of installing MATLAB into<br><br>C:\Program Files\MATLAB<br><br>you should install it into <br><br>C:\Applications\MATLAB </P>
[此贴子已经被作者于2006-3-28 15:10:54编辑过]

评分

1

查看全部评分

发表于 2006-3-28 15:12 | 显示全部楼层

回复:(afly)求教com组件问题

<P>简单来说就是不能安装在C:\Program Files\这类目录之下</P>
 楼主| 发表于 2006-3-28 15:31 | 显示全部楼层
<P>谢谢您的指教!</P>
发表于 2006-4-16 19:09 | 显示全部楼层
我的是在根目录下可以!
发表于 2006-6-2 17:56 | 显示全部楼层
搂主~能教教我你的东西怎么做吗?
发表于 2006-6-3 14:12 | 显示全部楼层

回复:(afly)[求助]求教com组件问题

<P><FONT color=#ff0000>afly加威望1点,happy加威望2点</FONT></P>
<P>多情清秋<BR>06.6.3</P>
发表于 2006-8-28 17:57 | 显示全部楼层
我的是安在根目录下,但是还是出现了该问题,请指教
QQ280613398
谢谢
发表于 2006-9-2 14:06 | 显示全部楼层
安装在C:\Applications\MATLAB这个目录下就好了!
我就是这样的!!
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-3 12:50 , Processed in 0.108248 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表