Rapid implementation of VC and Matlab hybrid programming (3-1)

Source: Internet
Author: User
[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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.