如何在Yocto中安装OpenGL以解决“No GL implementation is available”错误
在Yocto系统中解决OpenGL缺失及Flutter渲染器启动失败问题
问题现象
- 运行Flutter应用时触发错误:
Failed to start Flutter renderer: No GL implementation is available. - 执行
pkg-config --exists --print-errors 'gtk+-3.0'检查依赖时,返回如下错误:
root@apalis-imx8-07013820:/usr/lib/pkgconfig# pkg-config --exists --print-errors 'gtk+-3.0' 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 Package 'gl', required by 'epoxy', not found
排查细节
- 已在Yocto的
local.conf中添加mesa包,但目标系统的/usr/lib/pkgconfig目录下找不到gl.pc文件 - 查看
epoxy.pc的内容,发现其私有依赖明确包含gl:
prefix=/usr libdir=${prefix}/lib includedir=${prefix}/include epoxy_has_glx=1 epoxy_has_egl=1 epoxy_has_wgl=0 Name: epoxy Description: GL dispatch library Version: 1.5.10 Requires.private: x11, egl, gl egl Libs: -L${libdir} -lepoxy Libs.private: -ldl Cflags: -I${includedir}
已尝试操作
- 在Yocto构建配置中添加
mesa包进行编译,但部署到目标系统后,仍然出现No GL implementation is available错误
求助需求
请指导如何在Yocto中正确配置并安装OpenGL,解决上述两个错误,同时确保gl.pc文件存在于/usr/lib/pkgconfig目录中。
内容的提问来源于stack exchange,提问作者Hareendran MG
相关产品推荐
相关产品推荐

