主题:求教:如何在c语言中调用matlab
我按matlab帮助文档中的说明做,总出错,错误代码如下,哪位帮忙解决下,谢谢!
>> mex -v C:\MATLAB701\bin\win32\mexopts\lccopts.bat C:\MATLAB701\work\engwindemo.c
This is mex, Copyright 1984-2003 The MathWorks, Inc.
Select a compiler:
[1] Lcc C version 2.4 in C:\MATLAB701\sys\lcc
[2] Microsoft Visual C/C++ version 6.0 in D:\Program Files\Microsoft Visual Studio
[0] None
Compiler: 1
Try to update options file: C:\Documents and Settings\贾春茂\Application Data\MathWorks\MATLAB\R14\mexopts.bat
From template: C:\MATLAB701\BIN\WIN32\mexopts\lccopts.bat
Done . . .
-> Default options filename found in C:\Documents and Settings\贾春茂\Application Data\MathWorks\MATLAB\R14
----------------------------------------------------------------
-> Options file = C:\Documents and Settings\贾春茂\Application Data\MathWorks\MATLAB\R14\mexopts.bat
MATLAB = C:\MATLAB701
-> COMPILER = lcc
-> Compiler flags:
COMPFLAGS = -c -Zp8 -I"C:\MATLAB701\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup
OPTIMFLAGS = -DNDEBUG
DEBUGFLAGS = -g4
arguments =
Name switch = -Fo
-> Pre-linking commands =
-> LINKER = lcclnk
-> Link directives:
LINKFLAGS = -tmpdir "." -dll "C:\MATLAB701\extern\lib\win32\lcc\mexFunction.def" -L"C:\MATLAB701\sys\lcc\lib" -libpath "C:\MATLAB701\extern\lib\win32\lcc" _lib86652.obj
LINKFLAGSPOST = libmx.lib libmex.lib libmat.lib
Name directive = -o "lccopts.dll"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = lrc -I"C:\MATLAB701\sys\lcc\include" -noregistrylookup -fo"mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> "lcc -c -Zp8 -I"C:\MATLAB701\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup -Foengwindemo.obj -IC:\MATLAB701\extern\include -IC:\MATLAB701\simulink\include -DNDEBUG C:\MATLAB701\work\engwindemo.c"
--> "lcc -c -Zp8 -I"C:\MATLAB701\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup "C:\MATLAB701\sys\lcc\mex\lccstub.c" -Fo_lib86652.obj"
Contents of 8665_tmp.rsp:
C:\MATLAB701\bin\win32\mexopts\lccopts.bat engwindemo.obj
--> "lcclnk -o "lccopts.dll" -tmpdir "." -dll "C:\MATLAB701\extern\lib\win32\lcc\mexFunction.def" -L"C:\MATLAB701\sys\lcc\lib" -libpath "C:\MATLAB701\extern\lib\win32\lcc" _lib86652.obj -s @8665_tmp.rsp libmx.lib libmex.lib libmat.lib"
c:\matlab701\bin\win32\mexopts\lccopts.bat: unknown file type
C:\MATLAB701\BIN\WIN32\MEX.PL: Error: Link of 'lccopts.dll' failed.
??? Error using ==> mex
Unable to complete successfully
>> mex -v C:\MATLAB701\bin\win32\mexopts\lccopts.bat C:\MATLAB701\work\engwindemo.c
This is mex, Copyright 1984-2003 The MathWorks, Inc.
Select a compiler:
[1] Lcc C version 2.4 in C:\MATLAB701\sys\lcc
[2] Microsoft Visual C/C++ version 6.0 in D:\Program Files\Microsoft Visual Studio
[0] None
Compiler: 1
Try to update options file: C:\Documents and Settings\贾春茂\Application Data\MathWorks\MATLAB\R14\mexopts.bat
From template: C:\MATLAB701\BIN\WIN32\mexopts\lccopts.bat
Done . . .
-> Default options filename found in C:\Documents and Settings\贾春茂\Application Data\MathWorks\MATLAB\R14
----------------------------------------------------------------
-> Options file = C:\Documents and Settings\贾春茂\Application Data\MathWorks\MATLAB\R14\mexopts.bat
MATLAB = C:\MATLAB701
-> COMPILER = lcc
-> Compiler flags:
COMPFLAGS = -c -Zp8 -I"C:\MATLAB701\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup
OPTIMFLAGS = -DNDEBUG
DEBUGFLAGS = -g4
arguments =
Name switch = -Fo
-> Pre-linking commands =
-> LINKER = lcclnk
-> Link directives:
LINKFLAGS = -tmpdir "." -dll "C:\MATLAB701\extern\lib\win32\lcc\mexFunction.def" -L"C:\MATLAB701\sys\lcc\lib" -libpath "C:\MATLAB701\extern\lib\win32\lcc" _lib86652.obj
LINKFLAGSPOST = libmx.lib libmex.lib libmat.lib
Name directive = -o "lccopts.dll"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = lrc -I"C:\MATLAB701\sys\lcc\include" -noregistrylookup -fo"mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> "lcc -c -Zp8 -I"C:\MATLAB701\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup -Foengwindemo.obj -IC:\MATLAB701\extern\include -IC:\MATLAB701\simulink\include -DNDEBUG C:\MATLAB701\work\engwindemo.c"
--> "lcc -c -Zp8 -I"C:\MATLAB701\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup "C:\MATLAB701\sys\lcc\mex\lccstub.c" -Fo_lib86652.obj"
Contents of 8665_tmp.rsp:
C:\MATLAB701\bin\win32\mexopts\lccopts.bat engwindemo.obj
--> "lcclnk -o "lccopts.dll" -tmpdir "." -dll "C:\MATLAB701\extern\lib\win32\lcc\mexFunction.def" -L"C:\MATLAB701\sys\lcc\lib" -libpath "C:\MATLAB701\extern\lib\win32\lcc" _lib86652.obj -s @8665_tmp.rsp libmx.lib libmex.lib libmat.lib"
c:\matlab701\bin\win32\mexopts\lccopts.bat: unknown file type
C:\MATLAB701\BIN\WIN32\MEX.PL: Error: Link of 'lccopts.dll' failed.
??? Error using ==> mex
Unable to complete successfully