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即可

相关推荐
王码码203521 小时前
Go语言中的Elasticsearch操作:olivere实战
后端·golang·go·接口
Tomhex21 小时前
Go语言import用法详解
golang·go
Tomhex1 天前
Golang空白导入的真正用途
golang·go
Wenweno0o1 天前
Eino - 从0到1跑通大模型调用
golang·大模型·智能体·eino
不会写DN1 天前
IPv4 与 IPv6 的核心区别
计算机网络·面试·golang
Flandern11111 天前
Go程序员学习AI大模型项目实战02:给 AI 装上“大脑”:从配置解包到流式生成的深度拆解
人工智能·后端·python·学习·golang
ん贤1 天前
Go GC 非玄学,而是 CPU 和内存的权衡
开发语言·后端·golang·性能调优·gc
Dontla2 天前
go语言Windows安装教程(安装go安装Golang安装)(GOPATH、Go Modules)
开发语言·windows·golang
铁东博客2 天前
Go实现周易大衍筮法三变取爻
开发语言·后端·golang
wechat_Neal2 天前
Golang的车载应用场景
开发语言·后端·golang