dongjun1101 发表于 2007-4-28 12:14

matlab7.0和C++的接口问题

我要用matlab7.0做毕业设计,在刚装上的时候要建立两个C的接口文件,分别为afdtdpbg.c和fdtdpbg.c,执行步骤为先把它们贴到MATLAB的WORK目录下面,然后打开MATLAB,输入mex afdtdpbg.c回车,选数字2;再输入mex fdtdpbg.c,回车,理论上是应该出现两个.DLL文件,即借口文件,可是却出现下面的报错,
To get started, select MATLAB Help or Demos from the Help menu.

>> mex afdtdpbg.c

D:\1\BIN\WIN32\MEX.PL: Error: Compile of 'afdtdpbg.c' failed.

??? Error using ==> mex
Unable to complete successfully

>>



请问这是怎么回事呢,拜托大家帮个忙

eight 发表于 2007-4-28 12:45

原帖由 dongjun1101 于 2007-4-28 12:14 发表
我要用matlab7.0做毕业设计,在刚装上的时候要建立两个C的接口文件,分别为afdtdpbg.c和fdtdpbg.c,执行步骤为先把它们贴到MATLAB的WORK目录下面,然后打开MATLAB,输入mex afdtdpbg.c回车,选数字2;再输入mex fdtdpb ...
先 mbuild -setup,再 mex -setup

这类问题 google 一下就找到答案了,论坛也讨论过多次,下次建议自己先动手

dongjun1101 发表于 2007-4-28 12:49

我第一次用这个,不太明白的,是卸了,再按你说的步骤装吗:@L

dongjun1101 发表于 2007-4-28 12:50

mbuild -setup是什么意思?

eight 发表于 2007-4-28 12:51

原帖由 dongjun1101 于 2007-4-28 12:49 发表
我第一次用这个,不太明白的,是卸了,再按你说的步骤装吗:@L

当然,不过前提是你电脑安装了VC,再在matlab设置

dongjun1101 发表于 2007-4-28 12:57

那我把MATLAB卸了,C就不用在再
装了吧

dongjun1101 发表于 2007-4-28 13:03

这样就可以生成.DLL的接口文件了吗?只在控制面板上卸载可以卸干净吗?
我都快成问题少女了,:@L

eight 发表于 2007-4-28 13:13

原帖由 dongjun1101 于 2007-4-28 13:03 发表
这样就可以生成.DLL的接口文件了吗?只在控制面板上卸载可以卸干净吗?
我都快成问题少女了,:@L

可以卸载干净

matlab 删除重装后估计 C 应该不用重装

dongjun1101 发表于 2007-4-28 13:18

好的,我试试看,:loveliness:

[ 本帖最后由 eight 于 2007-4-28 13:24 编辑 ]

dongjun1101 发表于 2007-4-28 13:49

还是不行>> mex afdtdpbg.c

D:\MATLAB7.0\BIN\WIN32\MEX.PL: Error: Compile of 'afdtdpbg.c' failed.

??? Error using ==> mex
Unable to complete successfully

>>

eight 发表于 2007-4-28 13:51

原帖由 dongjun1101 于 2007-4-28 13:49 发表
还是不行>> mex afdtdpbg.c

D:\MATLAB7.0\BIN\WIN32\MEX.PL: Error: Compile of 'afdtdpbg.c' failed.

??? Error using ==> mex
Unable to complete successfully

>>

把 mbuild 和 mex 两个setup的结果贴上来

dongjun1101 发表于 2007-4-28 13:54

To get started, select MATLAB Help or Demos from the Help menu.

>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:

Would you like mbuild to locate installed compilers /n? y

Select a compiler:
Lcc C version 2.4 in D:\MATLAB7.0\sys\lcc
Microsoft Visual C/C++ version 6.0 in E:

None

Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C/C++ 6.0
Location: E:

Are these correct?(/n): y
Warning: Mbuild requires that the Microsoft Visual C++ 6.0
directories "VC98" and "Common" be located within the same parent directory.
(Expected to find a directory named "Common" in the directory 'E:'.)
Try to update options file: C:\Documents and Settings\xiaowei\Application Data\MathWorks\MATLAB\R14\compopts.bat
From template:            D:\MATLAB7.0\BIN\WIN32\mbuildopts\msvc60compp.bat

Done . . .


--> "D:\MATLAB7.0\bin\win32\mwregsvr D:\MATLAB7.0\bin\win32\mwcomutil.dll"

DllRegisterServer in D:\MATLAB7.0\bin\win32\mwcomutil.dll succeeded

--> "D:\MATLAB7.0\bin\win32\mwregsvr D:\MATLAB7.0\bin\win32\mwcommgr.dll"

DllRegisterServer in D:\MATLAB7.0\bin\win32\mwcommgr.dll succeeded

>> 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:\MATLAB7.0\sys\lcc
Microsoft Visual C/C++ version 6.0 in E:

None

Compiler: 3
Please select from 0-2
Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C/C++ 6.0
Location: E:

Are these correct?(/n): y
Warning: Mex requires that the Microsoft Visual C++ 6.0
directories "VC98" and "Common" be located within the same parent directory.
(Expected to find a directory named "Common" in the directory 'E:'.)
Try to update options file: C:\Documents and Settings\xiaowei\Application Data\MathWorks\MATLAB\R14\mexopts.bat
From template:            D:\MATLAB7.0\BIN\WIN32\mexopts\msvc60opts.bat

Done . . .

>> mex afdtdpbg.c

D:\MATLAB7.0\BIN\WIN32\MEX.PL: Error: Compile of 'afdtdpbg.c' failed.

??? Error using ==> mex
Unable to complete successfully

>>

eight 发表于 2007-4-28 13:59

Warning: Mbuild requires that the Microsoft Visual C++ 6.0
directories "VC98" and "Common" be located within the same parent directory.
(Expected to find a directory named "Common" in the directory 'E:'.)
Try to update options file: C:\Documents and Settings\xiaowei\Application Data\MathWorks\MATLAB\R14\compopts.bat
From template:            D:\MATLAB7.0\BIN\WIN32\mbuildopts\msvc60compp.bat

估计是上面的warning造成的,按照它的提示先手动修改一下吧

dongjun1101 发表于 2007-4-28 14:04

呵呵,这个是什么意思啊?

eight 发表于 2007-4-28 14:08

原帖由 dongjun1101 于 2007-4-28 14:04 发表
呵呵,这个是什么意思啊?

自己用金山词霸等工具翻译一下吧
页: [1] 2
查看完整版本: matlab7.0和C++的接口问题