咕噜代码:
package main
import (
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
)
func main() {
application := app.New()
window = application.NewWindow("Hello rohan")
window.SetContent(widget.NewLabel("Hello again"))
window.ShowAndRun()
}
执行此代码时,我收到以下错误。
# pkg-config --cflags -- gl gl
Package gl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gl' found
Package gl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gl' found
pkg-config: exit status 1
# fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfw
In file included from ./glfw/src/internal.h:188,
from ./glfw/src/context.c:30,
from ../../../go/src/fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw.go:4:
./glfw/src/x11_platform.h:36:10: fatal error: X11/Xcursor/Xcursor.h: No such file or directory
36 | #include <X11/Xcursor/Xcursor.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
任何关于这个问题的解决方案或建议将不胜感激。P.S 我在Windows上使用Go版本1.13.8和ubuntu 20.04 WSL。
运行命令后,我现在收到此错误:sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev
2020/12/21 12:12:19 PlatformError: X11: The DISPLAY environment variable is missing
panic: NotInitialized: The GLFW library is not initialized
goroutine 1 [running, locked to thread]:
fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfw.acceptError(0x0, 0x0, 0x0, 0x4332bd, 0x991100)
/home/rohan/go/src/fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfw/error.go:174 +0x216
fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfw.panicError(...)
/home/rohan/go/src/fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfw/error.go:185
希望有人可以帮助我,或者给我任何关于如何解决它的建议。
繁花如伊
Qyouu
相关分类