咕噜代码:package mainimport ( "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 glPackage 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 variableNo package 'gl' foundPackage 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 variableNo package 'gl' foundpkg-config: exit status 1# fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.3/glfwIn 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 missingpanic: NotInitialized: The GLFW library is not initializedgoroutine 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 +0x216fyne.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希望有人可以帮助我,或者给我任何关于如何解决它的建议。
2 回答
繁花如伊
TA贡献2012条经验 获得超12个赞
某些 Linux 系统缺少已安装的图形库的编译头。值得庆幸的是,这仅用于开发 - 应用程序将在没有遇到这种情况的情况下运行。
对于 Ubuntu 或 Debian,请尝试 .安装因平台而异,详情请见 https://developer.fyne.io/started/sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev
Qyouu
TA贡献1786条经验 获得超11个赞
我在Linux Mint上有同样的问题,这很有帮助:
locate pkgconfig/gl.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/gl.pc
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
- 2 回答
- 0 关注
- 414 浏览
添加回答
举报
0/150
提交
取消