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

相关推荐
念何架构之路15 小时前
Go reflect 包:结构体反射 —Field、Tag 与 VisibleFields
java·数据库·golang
喵了几个咪17 小时前
GoWind Admin 拆解:一个 Sender 接口接 39 个通知渠道
微服务·golang·go·1024程序员节·admin·gowind
紧跟先前的步伐20 小时前
Go AI Agent 实战 13|大模型流式输出 Streaming 的实现
人工智能·ai·golang·1024程序员节
喵了几个咪20 小时前
GoWind Ops 深度拆解:纯出站 Agent + MQTT 信令,把「管机器、跑项目、发脚本、构建分发」做扎实
golang·gowind
紧跟先前的步伐1 天前
Go AI Agent 实战 14|多轮对话与上下文历史管理
人工智能·ai·golang·1024程序员节
microrain1 天前
设备报文怎么变,SagooIoT 只约定三个函数名
javascript·物联网·golang·sagooiot
紧跟先前的步伐1 天前
Go AI Agent 实战 15|context.Context、超时与取消机制
人工智能·安全·ai·golang·1024程序员节
编程的一拳超人1 天前
【元宝搜索开发者征文大赛】四语实战:Java/Python/Go/Node.js 构建 AI 搜索应用全攻略
java·python·golang·node.js·agent
飞鸟真人2 天前
IM网关系列(九)单账号流量统计:滑动窗口桶方案设计与Go实现
后端·golang