声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 6647|回复: 8

[混合编程] [求助]设置Matlab C/C++编译器时出错

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

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

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

x
<P >本人在<FONT face="Times New Roman">Matlab</FONT>环境中配置<FONT face="Times New Roman">VC++</FONT>编译器时,<FONT face="Times New Roman">mex –setup</FONT>和<FONT face="Times New Roman">cd(prefdir)</FONT>命令都能运行,但输入<FONT face="Times New Roman">mccsavepath</FONT>命令后<FONT face="Times New Roman">Matlab</FONT>提示找不到这个函数,这是为什么呢?而且<FONT face="Times New Roman">mex –setup</FONT>运行后也不是显示“<FONT face="Times New Roman">Installing the MATLAB Visual Studio add-in</FONT>……”的信息,而是如下:</P>
<P ><FONT face="Times New Roman"> <p></p></FONT></P>
<P ><FONT face="Times New Roman">&gt;&gt; mex -setup</FONT></P>
<P ><FONT face="Times New Roman">Please choose your compiler for building external interface (MEX) files: </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Would you like mex to locate installed compilers [y]/n? y</FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Select a compiler: </FONT></P>
<P ><FONT face="Times New Roman">[1] Digital Visual Fortran version 6.0 in C:\Program Files\Microsoft Visual Studio </FONT></P>
<P ><FONT face="Times New Roman">[2] Lcc C version 2.4 in E:\MATLAB701\sys\lcc </FONT></P>
<P ><FONT face="Times New Roman">[3] Microsoft Visual C/C++ version 6.0 in C:\Program Files\Microsoft Visual Studio </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">[0] None </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Compiler: 3</FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Please verify your choices: </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Compiler: Microsoft Visual C/C++ 6.0 </FONT></P>
<P ><FONT face="Times New Roman">Location: C:\Program Files\Microsoft Visual Studio </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Are these correct?([y]/n): y</FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Try to update options file: C:\Documents and Settings\kke\Application Data\MathWorks\MATLAB\R14\mexopts.bat </FONT></P>
<P ><FONT face="Times New Roman">From template:              E:\MATLAB701\BIN\WIN32\mexopts\msvc60opts.bat </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">Done . . . </FONT></P>
<P ><FONT face="Times New Roman"> </FONT></P>
<P ><FONT face="Times New Roman">&gt;&gt; cd(prefdir)</FONT></P>
<P ><FONT face="Times New Roman">&gt;&gt; mccsavepath</FONT></P>
<P ><FONT face="Times New Roman">??? Undefined function or variable 'mccsavepath'.</FONT></P>
<P ><FONT face="Times New Roman"> <p></p></FONT></P>
<P ><FONT face="Times New Roman">&gt;&gt;</FONT></P>
<P ><FONT face="Times New Roman"> <p></p></FONT></P>
<P >这又是为什么呢?请各位帮帮忙,谢谢大家!</P>
回复
分享到:

使用道具 举报

发表于 2006-2-16 15:59 | 显示全部楼层
mcc savepath分开写,看看。
发表于 2006-2-16 20:28 | 显示全部楼层
<P><FONT face="Times New Roman">&gt;&gt; cd(prefdir)</FONT></P>
<P><FONT face="Times New Roman">&gt;&gt; mccsavepath<BR>这两个命令是什么意思,我在机子上试了一下没有出现错误,可以通过。你可以检查一下你的编译器设置正确了没有,通过以下方法。<BR></P>
<P 0cm 0cm 0pt">在命令窗口中输入:</P>
<P 0cm 0cm 0pt"> cd   % matlab根目录\extern\examples\mex\</P>
<P 0cm 0cm 0pt">然后输入:</P>
<P 0cm 0cm 0pt">   mex  yprime.c</P>
<P 0cm 0cm 0pt">如果配置好了编译器的默认配置文件,那么yprime .dll文件已经生成,到matlab根目录下的extern\examples\mex下就可以看到这个文件。</P>
<P 0cm 0cm 0pt">运行yprime(1,1:4)</P>
<P 0cm 0cm 0pt">得到结果:</P>
<P 0cm 0cm 0pt"> ans= </P>
<P 0cm 0cm 0pt">     2.0000    8.9685  4.0000   -1.0947</P>
<P 0cm 0cm 0pt">如果配置不成功,那么就会报错,根据错误原因再重新配置编译器的默认配置文件。</P>
<P 0cm 0cm 0pt">这是书上的一段原话。<BR></P>
<P>看看有没有帮助。</FONT></P>
发表于 2007-3-12 11:22 | 显示全部楼层

也请教c++ 编译器MATLAB环境配置出错

我也遇上楼主的问题,请问楼主解决否,也请指教一二,到底如何解决

[ 本帖最后由 chuxian 于 2007-3-12 11:23 编辑 ]
发表于 2007-4-25 15:43 | 显示全部楼层

同求助

我也遇到了同样的问题,不知道怎么办啊。
发表于 2007-8-3 14:39 | 显示全部楼层
同是天涯沦落人啊,我也是。总是配置不好编译器的默认配置文件啊
发表于 2007-11-8 11:17 | 显示全部楼层

求助

我也遇到这样的问题,请问楼主解决这个问题了吗?是否可以指导指导?
多谢了
发表于 2009-8-19 10:52 | 显示全部楼层
也遇到了同样的问题
发表于 2009-9-30 19:25 | 显示全部楼层
>> mex -setup
Please choose your compiler for building external interface (MEX) files:

Would you like mex to locate installed compilers [y]/n? y

Select a compiler:
[1] Lcc C version 2.4 in D:\MATLAB\sys\lcc

[0] None

Compiler: 1

Please verify your choices:

Compiler: Lcc C 2.4
Location: D:\MATLAB\sys\lcc

Are these correct?([y]/n): y

The default options file:
"C:\Documents and Settings\leebib\Application Data\MathWorks\MATLAB\R13\mexopts.bat"
is being updated from D:\MATLAB\BIN\WIN32\mexopts\lccopts.bat...
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-10 11:36 , Processed in 0.055210 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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