go wails doctor提示Required dependencies missing: libwebkit

复制代码
# Diagnosis
Required package(s) installation details: 
  - libgtk-3: sudo apt install libgtk-3-dev
  - libwebkit: sudo apt install libwebkit2gtk-4.0-dev
  - pkg-config: sudo apt install pkg-config

Optional package(s) installation details: 
  - docker: sudo apt install docker.io
  - nsis: sudo apt install nsis

 WARNING  Your system has missing dependencies!
Fatal:
Required dependencies missing: libwebkit

wails doctor诊断结果如上,此时根据提示需要先执行sudo apt install libgtk-3-dev安装 libgtk-3,紧接着执行第二行的sudo apt install libwebkit2gtk-4.0-dev时提示无法找到该软件包,此时若是你忽略该错误编译运行的话会提示

复制代码
Package webkit2gtk-4.1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.1.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.1', required by 'virtual:world', not found
Package 'webkit2gtk-4.1', required by 'virtual:world', not found
Package 'webkit2gtk-4.1', required by 'virtual:world', not found
Package 'libsoup-3.0', required by 'virtual:world', not found
Package 'webkit2gtk-4.1', required by 'virtual:world', not found

Build error - exit status 1

其实替换成sudo apt install libwebkit2gtk-4.1-0,再udo apt install libwebkit2gtk-4.1-dev就可以了,不过此时你执行wails doctor仍会有如下提示

复制代码
# Diagnosis
Optional package(s) installation details: 
  - docker: sudo apt install docker.io
  - nsis: sudo apt install nsis

 WARNING  Your system has missing dependencies!
Fatal:
Required dependencies missing: libwebkit

不用理会,编译运行时在命令后面加 -tags webkit2_41即可,例如 wails dev -tags webkit2_41即可

相关推荐
2501_941805315 小时前
使用Python和Go构建高性能分布式任务调度系统的实践分享
分布式·python·golang
有谁看见我的剑了?10 小时前
使用 go get github.com/go-sql-driver/mysql 驱动失败
golang
无心水10 小时前
2、Go语言源码文件组织与命令源码文件实战指南
开发语言·人工智能·后端·机器学习·golang·go·gopath
阿里云云原生10 小时前
阿里云可观测联合 Datadog 发布 OpenTelemetry Go 自动插桩工具
阿里云·golang·云计算·可观测
张丶大帅11 小时前
【走进Golang】
开发语言·后端·golang
无心水11 小时前
8、吃透Go语言container包:链表(List)与环(Ring)的核心原理+避坑指南
java·开发语言·链表·微服务·架构·golang·list
源代码•宸11 小时前
Golang原理剖析(Go语言垃圾回收GC)
经验分享·后端·算法·面试·golang·stw·三色标记
无心水11 小时前
6、Go语言类型判断与转换避坑指南:从类型断言到别名类型全解析
开发语言·后端·golang
且去填词12 小时前
并发模式(Patterns):Worker Pool 与 Pipeline 模式实现
golang·并发·数据流水线