Nominate our 2022 Qt Champions!

Undefined symbol when trying to run hellogl_es2 with QtEmbedded

  • Hi! I'm trying to run a OpenGL enabled application using QtEmbedded. Examples which are not using OpenGL work correctly, but when I try hellogl_es2 this is what I get:

    @./hellogl_es2: symbol lookup error: /usr/local/Trolltech/QtEmbedded-rock-4.7.2_opengl/lib/ undefined symbol: _ZN11QEglContextC1Ev@

    I thought I made some mistakes in linking the EGL libraries, but it seems I compiled and I'm running with the same libraries. So, maybe something was defined in the headers and now cannot be found runtime. Is there anything I can do to solve this problem? I cannot modify the EGL and the OpenGL ES libraries cause those are provided with the board. Has anyone ever experienced something similar?

  • That symbol is exported from QtGui so either you are not linking against QtGui (unlikely) or QtGui has not been built with support for EGL. You can check if EGL support is enabled by adding this to your .pro file:

    @!contains(QT_CONFIG, egl) {
    message("No EGL support!");

    Alternatively you can check the contents of the QT_CONFIG variable manually in mkspecs\qconfig.pri. Note that adding "egl" to this file is not sufficient for enabling EGL, you also need to rebuild QtGui. Support for EGL should be enabled automatically when you configure Qt with "-opengl es2" (not sure about es1), but you can additionally configure with "-egl" to explicitly enable support for it.

  • You were right indeed. With strace I could see that it was taking some libraries (QtGui in this case) from another Qt build. Now I solved the problem. Thanks!

Log in to reply