Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-78453

Qt android cmake: missing link to GLESv2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.13.1
    • Build tools: Other
    • None
    • Android

    Description

      When using a cmake project targetting android, GLESv2 is missing on the librairies that the executable links to (noticed when comparing the linker command produced by an equivalent QMake .pro file), which can lead to problems when using any graphical feature of Qt, namely my own error being:

      C:\Qt\5.13.1\android_armv7\include\QtGui/qopenglfunctions.h:790: error: undefined reference to 'glFlush'
      

      By adding to the CMakeLists.txt:

      if (ANDROID)
          target_link_libraries(${PROJECT_NAME} PRIVATE GLESv2)
      endif()
      

      The problem is fixed and my application compiles and runs fine.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              liaqi Liang Qi
              shao shao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes