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 ).