avisnet's blog

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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

posted on 2006-09-21 17:51  avisnet  阅读(1435)  评论(0编辑  收藏  举报