afly 发表于 2006-3-24 21:50

[求助]求教com组件问题

<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编辑过]

happy 发表于 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>

afly 发表于 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>

happy 发表于 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编辑过]

happy 发表于 2006-3-28 15:12

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

<P>简单来说就是不能安装在C:\Program Files\这类目录之下</P>

afly 发表于 2006-3-28 15:31

<P>谢谢您的指教!</P>

assist 发表于 2006-4-16 19:09

我的是在根目录下可以!

GRF-KYO 发表于 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>

youneng 发表于 2006-8-28 17:57

我的是安在根目录下,但是还是出现了该问题,请指教
QQ280613398
谢谢

aomy_ren 发表于 2006-9-2 14:06

安装在C:\Applications\MATLAB这个目录下就好了!
我就是这样的!!
页: [1]
查看完整版本: [求助]求教com组件问题