请教vc与matlab的混合编程问题
我的环境是vc6.0和matlab7.1,想在matlab里做算法,然后导出成标准DLL供vc调用,网上找了篇资料
http://blog.csdn.net/favory/archive/2007/05/19/1615899.aspx
我是按照这里的步骤做的,但是在matlab中生成dll时总是报错,也没有给出原因:
C:\MATLAB71\BIN\WIN32\\..\MEX.PL: Error: Compile of 'mylib.c' failed.
请问这是什么原因呢?
PS:附上matlab中mbuild和mex设置过程和结果,请大家帮我看看是不是有什么问题
(1)mbuild -Setup
Are these correct?([y]/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 'D:\Program Files'.)
Try to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R14SP3\compopts.bat
From template: C:\MATLAB71\BIN\win32\mbuildopts\msvc60compp.bat
Done . . .
--> ""C:\matlab71\bin\win32\mwregsvr" "C:\matlab71\bin\win32\mwcomutil.dll""
DllRegisterServer in C:\matlab71\bin\win32\mwcomutil.dll succeeded
--> ""C:\matlab71\bin\win32\mwregsvr" "C:\matlab71\bin\win32\mwcommgr.dll""
DllRegisterServer in C:\matlab71\bin\win32\mwcommgr.dll succeeded
(2)mex -setup
Are these correct?([y]/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 'D:\Program Files'.)
Try to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R14SP3\mexopts.bat
From template: C:\MATLAB71\BIN\win32\mexopts\msvc60opts.bat
Done . . .
***************************************************************************
Warning: The file extension of 32-bit Windows MEX-files was changed
from ".dll" to ".mexw32" in MATLAB 7.1 (R14SP3). The generated
MEX-file will not be found by MATLAB versions prior to 7.1.
Use the -output option with the ".dll" file extension to
generate a MEX-file that can be called in previous versions.
For more information see:
MATLAB 7.1 Release Notes, New File Extension for MEX-Files on Windows
***************************************************************************