我尝试为基于Rockchip的主板(准确地说是Rock64)构建基于GLFW的应用程序。 Rockchip实现OpenGL ES,但不实现标准OpenGL。因此,我像这样设置GLFW(这是Go;但是我怀疑编程语言很重要):
if err := glfw.Init(); err != nil {
panic(err)
}
defer glfw.Terminate()
glfw.WindowHint(glfw.ClientAPI, glfw.OpenGLESAPI)
window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil)
当我尝试运行它时,我得到:
libGL error: unable to load driver: rockchip_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: rockchip
2019/04/14 16:46:56 Link error in program Program(0): ""
因此,看起来该应用程序尝试使用普通的libGL,但由于不可用而失败。我通过ldd
看了链接库:
linux-vdso.so.1 (0x0000007f959b7000)
libGLESv2.so => /usr/lib/aarch64-linux-gnu/libGLESv2.so (0x0000007f957ec000)
libX11.so.6 => /usr/lib/aarch64-linux-gnu/libX11.so.6 (0x0000007f956c3000)
libXrandr.so.2 => /usr/lib/aarch64-linux-gnu/libXrandr.so.2 (0x0000007f956a9000)
libXcursor.so.1 => /usr/lib/aarch64-linux-gnu/libXcursor.so.1 (0x0000007f95690000)
libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f955d6000)
libXinerama.so.1 => /usr/lib/aarch64-linux-gnu/libXinerama.so.1 (0x0000007f955c3000)
libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000007f955ae000)
libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007f95582000)
libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f95429000)
/lib/ld-linux-aarch64.so.1 (0x0000007f9598c000)
libdrm.so.2 => /usr/lib/aarch64-linux-gnu/libdrm.so.2 (0x0000007f9540a000)
libXfixes.so.3 => /usr/lib/aarch64-linux-gnu/libXfixes.so.3 (0x0000007f953f4000)
libXext.so.6 => /usr/lib/aarch64-linux-gnu/libXext.so.6 (0x0000007f953d4000)
libXdamage.so.1 => /usr/lib/aarch64-linux-gnu/libXdamage.so.1 (0x0000007f953c1000)
librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000007f953aa000)
libxcb.so.1 => /usr/lib/aarch64-linux-gnu/libxcb.so.1 (0x0000007f9537a000)
libXrender.so.1 => /usr/lib/aarch64-linux-gnu/libXrender.so.1 (0x0000007f95361000)
libXau.so.6 => /usr/lib/aarch64-linux-gnu/libXau.so.6 (0x0000007f9534e000)
libXdmcp.so.6 => /usr/lib/aarch64-linux-gnu/libXdmcp.so.6 (0x0000007f95339000)
libbsd.so.0 => /lib/aarch64-linux-gnu/libbsd.so.0 (0x0000007f95317000)
因此,可执行文件已正确链接到libGLESv2,而不是libGL(按预期;我已配置链接器标志-lGLESv2
)。由于libGL
不在返回列表中,因此可执行文件不应加载它。我怎么仍会出现此错误?我认为这与X11配置有关,但是GLFW是否应该解决这一问题?