gpt4 book ai didi

go - 无法安装 gotk3,出现 GdkMonitor 错误

转载 作者:数据小太阳 更新时间:2023-10-29 03:09:14 25 4
gpt4 key购买 nike

我尝试使用 gotk3 创建桌面应用程序。我按照 gotk3 wiki 中的说明进行操作还有这个installing-on-linux wiki安装它。但是后来我在执行 go get -v 时遇到了这个错误:

gcc errors for preamble:
In file included from ../../gotk3/gotk3/gdk/gdk_since_3_22.go:23:0:
./gdk_since_3_22.go.h:22:8: error: unknown type name 'GdkMonitor'
static GdkMonitor *
^

我已经尝试删除 gotk3 目录,然后再次尝试 go get -v,但仍然没有用。

我还使用 apt-cache policy libgtk2.0-0 libgtk-3-0 | 检查了我的 Ubuntu 16.04 中安装的 GTK 版本 | grep 已安装。它显示了这个:

  Installed: 2.24.30-1ubuntu1.16.04.2
Installed: 3.18.9-1ubuntu3.3

我做错了什么?谢谢

最佳答案

GdkMonitor 是在 GTK+ 3.22 中引入的。你的版本是3.18。

go get -tags gtk_3_18 github.com/gotk3/gotk3/gtk 在构建的最开始 (see here NOTE section) 应该可以解决问题

关于go - 无法安装 gotk3,出现 GdkMonitor 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54961274/

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