我正在尝试在Ubuntu Trusty系统上使用g++ 4.9.1连接一个非常简单的GLES2和EGL程序,我正在使用mesa库。但是我遇到了EGL函数的链接错误。
我尝试过更改库的顺序,但问题依旧。这里是否有我遗漏的库?
我已经运行了
test.cpp:(.text+0x342): undefined reference to `eglGetDisplay'
test.cpp:(.text+0x389): undefined reference to `eglInitialize'
test.cpp:(.text+0x40f): undefined reference to `eglCreateContext'
test.cpp:(.text+0x458): undefined reference to `eglCreatePbufferSurface'
test.cpp:(.text+0x49e): undefined reference to `eglMakeCurrent'
我正在使用以下命令编译test.cpp:
g++ -std=c++0x -Wall -Werror -lEGL -lGLESv2 -o test test.cpp
我尝试过更改库的顺序,但问题依旧。这里是否有我遗漏的库?
我已经运行了
readelf -Ws /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so
,所有必需的函数都已定义。