Static library using MFC in static library

Source: Internet
Author: User

Development tools: Visual Studio Pro

There are altogether two projects, one is a: project name MYSDK, Static library, multibyte, use MFC in static Library, runtime uses "multithreaded Debug DLL (/MDd)", and the other is B: Executable program, multibyte, use MFC in static library, add _afxdll to preprocessor definition, The runtime uses the multithreaded debug DLL (/MDD).

In project A's interface file:

#ifdef mysdkinterface_static #define Mysdkinterface_api#else#ifdef mysdkinterface_exports#define MYSDKINTERFACE_API __ Declspec (dllexport)#else#define mysdkinterface_api __declspec (dllimport)#endif# endif//  mysdkinterface_static

The preprocessor definition for project a increases mysdkinterface_static, the preprocessor definition for item B increases mysdkinterface_static, additional dependencies increase MySdk.lib, and the input library directory increases the directory where Lib resides.

The memory allocated by MYSDK needs to be released on its own and is not recommended for EXE.

Static library using MFC in static library

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.