请教vc与matlab的混合编程问题

babamama11 2010-04-25 04:12:01
我的环境是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
***************************************************************************


...全文
167 3 点赞 打赏 收藏 举报
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
thetenthtree 2010-09-22
我也遇到了同样的问题,楼主你解决了吗?
  • 打赏
  • 举报
回复
处处留心 2010-04-25
虽然两个我都用过,但从没混合用过
  • 打赏
  • 举报
回复
相关推荐
发帖
VC/MFC
创建于2007-09-28

1.5w+

社区成员

VC/MFC相关问题讨论
申请成为版主
帖子事件
创建了帖子
2010-04-25 04:12
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……