Golang GUI fyne-io帮助设置?

问题描述 投票:-1回答:2

我只是无法配置GUI fyne-iogo get fyne.io/fyne发了错误

package fyne.io/fyne:无法识别的导入路径“fyne.io/fyne”(https fetch:获取https://fyne.io/fyne?go- get = 1:拨打tcp:lookup fyne.io:没有这样的主机)

JetBrains的IDE从导入安装它是件好事

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

然后在运行时出现错误

exec:“gcc”:%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()
}

运行后出错

2019/03/26 13:51:11 Fyne错误:无法初始化OpenGL

2019/03/26 13:51:12原因:glClientWaitSync

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

panic:运行时错误:无效的内存地址或nil指针取消引用

[信号0xc0000005代码= 0x0 addr = 0x10 pc = 0x589c9d]

gl安装

go
2个回答
0
投票

问题1在您的DNS查找中看起来像是一个临时问题 - IDE很快解决了它。问题2在找到解决方案方面做得很好。问题3你最好在GitHub跟踪器上提出一个错误[1] - 详细介绍你的Windows版本和硬件,以便它可以与你一起工作。

1:https://github.com/fyne-io/fyne/issues


0
投票

来自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
© www.soinside.com 2019 - 2024. All rights reserved.