苏诗是什么电视剧:vc调用matcom出错

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 12:54:55
[求助]vc调用matcom出错1、启动MIDEVA ,File-> New,新建如下Test1.m文件:
x=1:0.1:10; y=sin(x); plot(x,y);
保存文件并编译:m文件保存的默认位置为:matcom安装目录\matcom45,生成的C++文件保存的默认位置为:matcom安装目录\matcom45\Debug\,本例matcom安装目录为C盘 即 C:\matcom45\Debug\,在该目录下将会产生Test1.h、Test1.cpp、Test1.r 、Test1.obj文件。
2、在VC中用MFC Wizard(exe)创建一个基于对话框名为Example的工程。
在面板上添加一个ID为IDC_BUTTON1按扭。
3、将C:\matcom45\Debug目录下的Test1.cpp文件的内容拷贝到void CExamleDlg::OnButton1()下
void CVc_matcomDlg::OnButton1()
{
// TODO: Add your control notification handler code here
initM (MATCOM_VERSION);
dMm(x); dMm(y);
#line 1 "d:/matcom4.5/matcom45/test.m"
call_stack_begin;
#line 1 "d:/matcom4.5/matcom45/test.m"
_ x = colon(1.0,0.1,10.0);
#line 1 "d:/matcom4.5/matcom45/test.m"
_ y = sin(x);
#line 1 "d:/matcom4.5/matcom45/test.m"
_ plot((CL(x),y));
call_stack_end;
exitM();
}
4、将C:\matcom45\lib\下的matlib.h 和v4501v文件和C:\matcom45\debug下的Test1.h文件拷贝到工程Example目录下,然后在VC中将库文件和头文件加入到工程中:工程-> 添加工程-> Files,选择刚刚拷贝到Example目录下的matlib.h 、v4501v和Test1.h文件
5、在ExamleDlg.cpp中加入如下代码:
#include "matlib.h"#include "Test1.h"
6、在void CExamleDlg::OnButton1()中分别添加一个初始化类库调用函数”initM(MATCOM_VERSION)”和一个结束类库调用函数”exitM();
运行程序,出现如下错误:
C:\Documents and Settings\Administrator\My Documents\vc6.0\vc_matcom\vc_matcomDlg.cpp(177) : error C2065: 'initM' : undeclared identifier
C:\Documents and Settings\Administrator\My Documents\vc6.0\vc_matcom\vc_matcomDlg.cpp(177) : error C2065: 'MATCOM_VERSION' : undeclared identifier
C:\Documents and Settings\Administrator\My Documents\vc6.0\vc_matcom\vc_matcomDlg.cpp(178) : error C2065: 'dMm' : undeclared identifier
C:\Documents and Settings\Administrator\My Documents\vc6.0\vc_matcom\vc_matcomDlg.cpp(178) : error C2065: 'x' : undeclared identifier
C:\Documents and Settings\Administrator\My Documents\vc6.0\vc_matcom\vc_matcomDlg.cpp(178) : error C2065: 'y' : undeclared identifier
d:/matcom4.5/matcom45/test.m(1) : error C2065: 'call_stack_begin' : undeclared identifier
d:/matcom4.5/matcom45/test.m(1) : error C2065: '_' : undeclared identifier
d:/matcom4.5/matcom45/test.m(1) : error C2146: syntax error : missing ';' before identifier 'x'
.....省了一些相识的错误
d:/matcom4.5/matcom45/test.m(1) : error C2065: 'colon' : d:/matcom4.5/matcom45/test.m(1) : error C2065: 'plot' : undeclared identifier
d:/matcom4.5/matcom45/test.m(1) : error C2065: 'CL' : undeclared identifier
d:/matcom4.5/matcom45/test.m(3) : error C2065: 'call_stack_end' : undeclared identifier
d:/matcom4.5/matcom45/test.m(5) : error C2065: 'exitM' : undeclared identifier
Error executing cl.exe.

vc_matcomDlg.obj - 16 error(s), 0 warning(s)

谁能帮我看一下呀。谢谢了。Email:linchch1983@163.com