[Original] rapid implementation of VC and Matlab hybrid programming (3-1)
Mailing site: BBS shuimu Tsinghua station (Mon May 19 21:30:19 2003)
3. Use the dynamic link library (*. dll) generated by MATLAB in VC ++)
To use the *. dll generated above in VC ++, you must first set the VC ++ environment:
(1) set the include and library Directories
In VC ++ IDE, choose tools> Options> directories.
In show directoris for:, select include files and add the following two directories:
<MATLAB> \ extern \ include \
<MATLAB> \ extern \ include \ CPP
In show directoris for:, select library files and add the following two directories:
<MATLAB> \ extern \ Lib \ Win32
<MATLAB> \ extern \ Lib \ Win32 \ microsof \ msvc6
Assume that <MATLAB> is the installation directory of your Matlab.
These operations only need to be performed once, And the VC ++ ide will automatically record them. Automatically applied to each project ).
(2) Project Settings
In VC ++ IDE, select project> setting> C/C ++
Select Code Generation in category and multithreaded DLL in use run-time library.
.
In category, select precompiled headers, select automatic use of precompiled headers, and
Add stdafx. h under the through header.
Select Preprocessor in category and add msvc, mswind, and IBMP to Preprocessor definitions.
C.
In VC ++ IDE, select project-> Settings-> Link
Select input in categories and enter msvcrt. Lib in ignore libraries.