Making and using static link library (. lib) files

Source: Internet
Author: User

(i) Production of. lib Files

(1) Open vs, select "New Project", select "Visual C + +" and select "Win32 Console Application".

(2) Click "OK", click "Next", set the following

(3) Click "Finish", then you can add. h and. cpp files to the project.

(4) After the code is written, right-click the project and tap the "Generate" button. Without errors, you can see the created. lib file in the Debug folder of the project.

(ii) using the. lib file

(1) Using LIB file requires two things, one is the header file added to the project, and the second is the generated. lib file.

(2) Configure project properties in projects that need to use LIB files, including "Include Directory", "Library Directory", and "Additional dependencies"

(3) "Include directory" is the path of the header file, "Library directory" is the path of the Lib file; "Additional Dependencies" is Xx.lib, which is the file name + suffix of the static connection library you generated.

Correct an error: In the Win32 Application Wizard, do not check the precompiled header option.

Making and using static link library (. lib) files

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.