|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我要实现MATLAB 的混合编程,因此必须有接口程序.
安装编译器.
首先安装mex -setup和mbuild -setup,都选择了相应编译器后.按确定:
Are these correct?([y]/n):
The default options file:
"C:\Documents and Settings\new\Application Data\MathWorks\MATLAB\R13\compopts.bat"
is being updated from C:\MATLAB6P5P1\BIN\WIN32\mbuildopts\msvc60compp.bat...
--> "C:\MATLAB6p5p1\bin\win32\mwregsvr C:\MATLAB6p5p1\bin\win32\mwcomutil.dll"
DllRegisterServer in C:\MATLAB6p5p1\bin\win32\mwcomutil.dll succeeded
--> "C:\MATLAB6p5p1\bin\win32\mwregsvr C:\MATLAB6p5p1\bin\win32\mwcommgr.dll"
DllRegisterServer in C:\MATLAB6p5p1\bin\win32\mwcommgr.dll succeeded
Installing the MATLAB Visual Studio add-in ...
Updated C:\Program Files\Microsoft Visual Studio\common\msdev98\template\MATLABWizard.awx
from C:\MATLAB6P5P1\BIN\WIN32\MATLABWizard.awx
Updated C:\Program Files\Microsoft Visual Studio\common\msdev98\template\MATLABWizard.hlp
from C:\MATLAB6P5P1\BIN\WIN32\MATLABWizard.hlp
Updated C:\Program Files\Microsoft Visual Studio\common\msdev98\addins\MATLABAddin.dll
from C:\MATLAB6P5P1\BIN\WIN32\MATLABAddin.dll
Merged C:\MATLAB6P5P1\BIN\WIN32\usertype.dat
with C:\Program Files\Microsoft Visual Studio\common\msdev98\bin\usertype.dat
Note: If you want to use the MATLAB Visual Studio add-in with the MATLAB C/C++
Compiler, you must start MATLAB and run the following commands:
cd(prefdir);
mccsavepath;
(You only have to do this configuration step once.)
出现上面的文字。是不是还没安装成功?
然后我根据飞思科技的那本书写的,想编译一个c文件为mex文件,以yprime.c为例进行.
写的是输入 cd(具体路径);mex yprime.c. 但是出现了错误,它的显示如下:
> cd %MATLAB根目录下\extern\examples\mex
C:\MATLAB6p5p1\extern\examples\mex
>> mex yprime.c
yprime.c
C:\MATLAB6p5p1\extern\include\matrix.h(131) : error C2146: syntax error : missing ')' before identifier 'n'
C:\MATLAB6p5p1\extern\include\matrix.h(131) : error C2061: syntax error : identifier 'n'
C:\MATLAB6p5p1\extern\include\matrix.h(131) : error C2059: syntax error : ';'
C:\MATLAB6p5p1\extern\include\matrix.h(132) : error C2059: syntax error : ')'
C:\MATLAB6p5p1\extern\include\matrix.h(139) : error C2146: syntax error : missing ')' before identifier 'n'
C:\MATLAB6p5p1\extern\include\matrix.h(139) : error C2061: syntax error : identifier 'n'
C:\MATLAB6p5p1\extern\include\matrix.h(139) : error C2059: syntax error : ';'
C:\MATLAB6p5p1\extern\include\matrix.h(139) : error C2059: syntax error : ','
C:\MATLAB6p5p1\extern\include\matrix.h(141) : error C2059: syntax error : ')'
C:\MATLAB6p5p1\extern\include\matrix.h(153) : error C2146: syntax error : missing ')' before identifier 'size'
C:\MATLAB6p5p1\extern\include\matrix.h(153) : error C2081: 'size_t' : name in formal parameter list illegal
C:\MATLAB6p5p1\extern\include\matrix.h(153) : error C2061: syntax error : identifier 'size'
C:\MATLAB6p5p1\extern\include\matrix.h(153) : error C2059: syntax error : ';'
C:\MATLAB6p5p1\extern\include\matrix.h(153) : error C2059: syntax error : ')'
C:\MATLAB6p5p1\extern\include\tmwtypes.h(486) : fatal error C1189: #error : "This code must be compiled using a 2's complement representation for signed integer values"
C:\MATLAB6P5P1\BIN\WIN32\MEX.PL: Error: Compile of 'yprime.c' failed.
??? Error using ==> mex
Unable to complete successfully
是不是编译器没安装成功啊? 哪位老师指导一下我.心里急!! |
|