未定义对GetStockObject @ 4的引用 [英] Undefined reference to GetStockObject@4

查看:63
本文介绍了未定义对GetStockObject @ 4的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Eclipse/MinGW/C中创建了一个程序(项目类型:C),该程序应该只显示一个空窗口.它也有以下一行:

I've created a program in Eclipse / MinGW / C (project type: C) which should just present an empty window. It also has the folowing line:

wndclassex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

GetStockObject()的调用会产生编译器错误:

The call to GetStockObject() produces a compiler error:

Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:29:未定义的引用`GetStockObject @ 4'

Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:29: undefined reference to `GetStockObject@4'

有人知道出什么事了吗?

Has anyone an idea what's wrong ?

推荐答案

检查文档,并确保您链接到所需的库( -lgdi32 ).

Check the documentation, and make sure you link to the required libraries (-lgdi32).

这篇关于未定义对GetStockObject @ 4的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆