Matlab 版 (精华区)
发信人: finance (淼水), 信区: MathTools
标 题: matlab5&vc5的解救办法[转]
发信站: BBS 水木清华站 (Mon Nov 9 22:03:17 1998) WWW-POST
在matlab5中用mex命令编译c程序,如果应用vc5编译器,会报错找不到文件。其解决办法
如下:
打开mexopts.bat文件,里面内容替换如下:
@echo off
rem MSVC50OPTS.BAT
rem
rem Compile and link options used for building MEX-files
rem using the Microsoft Visual C++ compiler version 5.0
rem
rem $Revision: 1.1 $ $Date: 1997/03/26 15:43:52 $
rem
rem ********************************************************************
rem General parameters
rem ********************************************************************
set MATLAB=%MATLAB% ---改为matlab安装目录,如:c:\matlab
set MSVC_ROOT=%MSVC_ROOT% ---改为vc5安装目录,如:c:\DevStudio
set MSVCDir=%MSVC_ROOT%\VC
set MSDevDir=%MSVC_ROOT%\sharedIDE
set PATH=%MSVCDir%\BIN;%MSDevDir%\bin;%PATH%
set INCLUDE=%MSVCDir%\INCLUDE;%MSVCDir%\MFC\INCLUDE;%MSVCDir%\ATL\INCLUDE;%INC
LUDE%
set LIB=%MSVCDir%\LIB;%MSVCDir%\MFC\LIB;%LIB%
rem ********************************************************************
rem Compiler parameters
rem ********************************************************************
set COMPILER=cl
set OPTIMFLAGS=-O2
set DEBUGFLAGS=-Zi
set COMPFLAGS=-c -Zp8 -G5 -W3 -DMATLAB_MEX_FILE
rem ********************************************************************
rem Library creation command
rem ********************************************************************
set PRELINK_CMDS=lib /def:%MATLAB%\extern\include\matlab.def /machine:ix86
/OUT:%LIB_NAME%1.lib
set PRELINK_DLLS=lib /def:%MATLAB%\extern\include\%DLL_NAME%.def
/machine:ix86 /OUT:%DLL_NAME%.lib
rem ********************************************************************
rem Linker parameters
rem ********************************************************************
set LINKER=link
set LINKFLAGS=/dll /export:mexFunction %LIB_NAME%1.lib /implib:%LIB_NAME%l.lib
set LINKOPTIMFLAGS=
set LINKDEBUGFLAGS=/debug
set LINK_FILE=
set LINK_LIB=
set NAME_OUTPUT=/out:%MEX_NAME%.dll
rem ********************************************************************
rem Resource compiler parameters
rem ********************************************************************
set RC_COMPILER=rc
set RC_LINKER=
--
行至水穷处,坐看云起时
***********************
菩提本无树,明镜亦非台
本来无一物,何处染尘埃
※ 修改:.fzx 于 Aug 10 12:52:02 修改本文.[FROM: heart.hit.edu.cn]
※ 转寄:.紫 丁 香 bbs.hit.edu.cn.[FROM: sys08.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.476毫秒