gpt4 book ai didi

c++ - 使用 GetDIBits 函数对 _imp__GetDIBits@28 的 undefined reference

转载 作者:行者123 更新时间:2023-11-28 02:03:17 24 4
gpt4 key购买 nike

我正在尝试在 Windows 上通过 C++(通过 QtCreator)使用 GetDIBits 函数。代码编译但无法链接报错

undefined reference to _imp__GetDIBits@28

我试过链接添加

LIBS = C:/MinGW/lib/libws2_32.a

到我的 .pro 文件,但没有任何改变。它是正确的库还是另一个库?谢谢

最佳答案

Gdi32.lib 链接。

一般来说,要确定链接哪个库,请在 msdn.microsoft.com 上查找 API,然后滚动到页面底部以获取 header 和库要求。

示例 here

关于c++ - 使用 GetDIBits 函数对 _imp__GetDIBits@28 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38529897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com