gpt4 book ai didi

Golang GUI fyne-io 帮忙设置?

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

我只是无法配置 GUI fyne-io . go get fyne.io/fyne 出错了

package fyne.io/fyne: unrecognized import path "fyne.io/fyne" (https fetch: Get https://fyne.io/fyne?go- get=1: dial tcp: lookup fyne.io: no such host)

JetBrains 的 IDE 从导入安装它很好

导入 (
“fyne.io/fyne/widget”
“fyne.io/fyne/app”
)

然后在go run出现错误

exec: “gcc”: executable file not found in %PATH%

安装 TDM-GCC帮助解决了问题

然后我就动不了了。

package main

import (
"fyne.io/fyne/widget"
"fyne.io/fyne/app"
)

func main() {
app := app.New()

w := app.NewWindow("Hello")
w.SetContent(widget.NewVBox(
widget.NewLabel("Hello Fyne!"),
widget.NewButton("Quit", func() {
app.Quit()
}),
))

w.ShowAndRun()
}

go运行后出错

2019/03/26 13:51:11 Fyne error: failed to initialise OpenGL

2019/03/26 13:51:12 Cause: glClientWaitSync

2019/03/26 13:51:12 At: C:/gopath/src/fyne.io/fyne/driver/gl/window.go:834

panic: runtime error: invalid memory address or nil pointer dereference

[signal 0xc0000005 code=0x0 addr=0x10 pc=0x589c9d]

gl安装

最佳答案

来自 fyne 文档

By default Fyne uses the gl golang bindings which means you need a working OpenGL configuration. Debian/Ubuntu based systems may also need to install the libgl1-mesa-dev and xorg-dev packages.

什么是 OpenGL?OpenGL是一个独立于操作系统、独立于窗口系统的图形渲染API,具有由几何和图像基元组成的高质量彩色图像。

OpenGL APIs can use following …

Gl
OpenGL API implementation (http://www.opengl.org)
Glu
OpenGL Utility
Glut – GLUT (OpenGL Utility Toolkit) – Glut is portable windowing API and it is not officially part of OpenGL.
OpenGL Utility Toolkit (http://www.opengl.org/resources/libraries/glut/)
FLTK
FlashLight ToolKit (http://www.fltk.org/)
GLEW…

运行以下命令安装 OpenGL。

sudo apt-get update
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev

关于Golang GUI fyne-io 帮忙设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55355428/

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