++copy from http://dirty.csie.ntu.edu.tw/mt/archives/000108.html
LINK : warning LNK4089: all references to "xxx.dll" discarded by /OPT:REF
For example:
LINK : warning LNK4089: all references to "GDI32.dll" discarded by /OPT:REF
The warning means that your program contains functions that call GDI, but the functions are never called, so the link to GDI is never actually used. For exmaple, this program will raise the
warning:
void CallGDI()
{
GetStockObject(WHITE_BRUSH);
}
int main(int argc, char**argv)
{
// notice that this function never calls the CallGDI function
return 1;
}
The linker is saying, "Um, you wrote some functions that use GDI, but you never called those functions, so I'm not sure what you're trying to do here."
===============================================================================
This is just the compiler trying to help you create a smaller program since you are not using the GDI functions anyway. If you want to avoid the message, use /OPT:NOREF but it will leave you with a larger executable.
PS. This is of course documented under the /OPT keyword.
===============================================================================
You can prevent the warning message by adding the following to your linker options.
/IGNORE:4089
No comments:
Post a Comment