Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Cross Compiling for Raspberry: QtCreator does not find GLES2/gl2.h
QtWS25 Last Chance

Cross Compiling for Raspberry: QtCreator does not find GLES2/gl2.h

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxwell31
    wrote on last edited by
    #1

    Hi,

    I cross compiled Qt for Raspberry on my Linux machine. I can perfectly compile my project using cmake on the command line. I tried to set up a kit in QtCreator so that I can debug on the device. However, when compiling through creator I get the error that

    GLES2/gl2.h is not found.

    I wonder what I am doing wrong. Of course I mounted the sysroot and set it in the kit. In the sysroot, I see that the required file is present under /opt/vc/include/GLES2

    Or should he use not the one of the sysroot? How can I make QtCreator look there?

    Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maxwell31
      wrote on last edited by maxwell31
      #2

      Ok, manually adding a line
      include_directories(/opt/vc/include/GLES2) to my cmake solves the issue (although I do not understand why it works without that line if I use cmake with a toolchain file)

      However, now I get the errors
      :-1: warning: libGLESv2.so, needed by /opt/qt5pi/lib/libQt5Quick.so.5.11.1, not found (try using -rpath or -rpath-link)
      :-1: warning: libz.so.1, needed by /opt/qt5pi/lib/libQt5Network.so.5.11.1, not found (try using -rpath or -rpath-link)
      :-1: warning: libpng16.so.16, needed by /opt/qt5pi/lib/libQt5Gui.so.5.11.1, not found (try using -rpath or -rpath-link)

      I don't really understand, does it want those libraries from the Sysroot? Ok, If I add
      link_directories(/opt/raspberry_sysroot/usr/lib/arm-linux-gnueabihf/)
      link_directories(/opt/raspberry_sysroot/usr/lib/)
      this problem disappears

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxwell31
        wrote on last edited by maxwell31
        #3

        But Now I get a new problem:
        libQt5Network.so.5.11.1 /opt/qt5pi/lib/libQt5Gui.so.5.11.1 common/libcommon.a /opt/qt5pi/lib/libQt5Core.so.5.11.1 && :
        /opt/raspberry_tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libc.so.6
        /opt/raspberry_tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libc_nonshared.a
        /opt/raspberry_tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3
        collect2: error: ld returned 1 exit status

        I don't understand why he is using the absolute path here

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maxwell31
          wrote on last edited by
          #4

          Or alternatively: Can I make QtCreator use my working Toolchain file?

          Pablo J. RoginaP 1 Reply Last reply
          0
          • M maxwell31

            Or alternatively: Can I make QtCreator use my working Toolchain file?

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @maxwell31 have you checked the Qt Creator section of this cross-compile guide for RPi?

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            1
            • M Offline
              M Offline
              maxwell31
              wrote on last edited by maxwell31
              #6

              Yes, I think I did it more or less according to this section. However, I did not use the rsync method but work with an image file. So the problem seems to be that he does not use the sysroot I specify in qt creator.

              Also, why does the linker look for
              /lib/arm-linux-gnueabihf/libc.so.6
              and not simply for libc.so.6 somewhere in the link path?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maxwell31
                wrote on last edited by
                #7

                I managed to get it working via manually setting CMAKE_FIND_ROOT_PATH to sysroot in the build settings of the kit

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved