[求助]设置Matlab C/C++编译器时出错
<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">>> 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 /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"> Digital Visual Fortran version 6.0 in C:\Program Files\Microsoft Visual Studio </FONT></P>
<P ><FONT face="Times New Roman"> Lcc C version 2.4 in E:\MATLAB701\sys\lcc </FONT></P>
<P ><FONT face="Times New Roman"> 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"> 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?(/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">>> cd(prefdir)</FONT></P>
<P ><FONT face="Times New Roman">>> 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">>></FONT></P>
<P ><FONT face="Times New Roman"> <p></p></FONT></P>
<P >这又是为什么呢?请各位帮帮忙,谢谢大家!</P> mcc savepath分开写,看看。 <P><FONT face="Times New Roman">>> cd(prefdir)</FONT></P>
<P><FONT face="Times New Roman">>> 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"> mexyprime.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.96854.0000 -1.0947</P>
<P 0cm 0cm 0pt">如果配置不成功,那么就会报错,根据错误原因再重新配置编译器的默认配置文件。</P>
<P 0cm 0cm 0pt">这是书上的一段原话。<BR></P>
<P>看看有没有帮助。</FONT></P>
也请教c++ 编译器MATLAB环境配置出错
我也遇上楼主的问题,请问楼主解决否,也请指教一二,到底如何解决[ 本帖最后由 chuxian 于 2007-3-12 11:23 编辑 ]
同求助
我也遇到了同样的问题,不知道怎么办啊。 同是天涯沦落人啊,我也是。总是配置不好编译器的默认配置文件啊求助
我也遇到这样的问题,请问楼主解决这个问题了吗?是否可以指导指导?多谢了 也遇到了同样的问题 >> mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers /n? y
Select a compiler:
Lcc C version 2.4 in D:\MATLAB\sys\lcc
None
Compiler: 1
Please verify your choices:
Compiler: Lcc C 2.4
Location: D:\MATLAB\sys\lcc
Are these correct?(/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...
页:
[1]