jjzjj

c - 对 GetStockObject@4 的 undefined reference

coder 2024-06-07 原文

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

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

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

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

有人知道哪里出了问题吗?

最佳答案

检查 documentation ,并确保链接到所需的库 (-lgdi32)。

关于c - 对 GetStockObject@4 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1340824/

有关c - 对 GetStockObject@4 的 undefined reference的更多相关文章

  1. c - 对 GetStockObject@4 的 undefined reference - 2

    我在Eclipse/MinGW/C中创建了一个程序(项目类型:C),它应该只显示一个空窗口。它还具有以下行:wndclassex.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);调用GetStockObject()产生编译器错误:Z:/mtsts_workspace/MTSTS/Debug/../WinMain.c:29:undefinedreferenceto`GetStockObject@4'有人知道哪里出了问题吗? 最佳答案 检查documentation,并确保链接到所需的

随机推荐