Discarded by/OPT: ref (VC debugging warning)

Source: Internet
Author: User
Today, the project for compiling the relese version is encountering [link: Warning lnk4089: all references to "gdi32.dll" discarded by/OPT: ref]
This warning solution:
1. on the project -- setting -- Link tab, add/OPT: Noref to project options.
2. on the project -- setting -- Link tab, add/ignore: 4089 to project options.
3. InProgramAdd # pragma warning (Disable: 4089)

Note:: Because the size of the file generated using [/ignore: 4089] is smaller than that of [/OPT: Noref], we recommend that you use [/ignore: 4089]

Find the following reasons on the Internet:
This warning simply means that you mistakenly connect to a library, and the compiler finds that you have not used the function. this warning is common when you do release version (release builds), because the/OPT: ref connector option is in release version (release builds) it is set to the command connector to correct your finalCodeAvoid connecting useless DLLs as much as possible (this makes the import address table of executable code as small as possible ).

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.