Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. failed to Cross compile Qt 5.6 on RPi 2 (fatal error: bcm_host.h: No such file or directory)
Forum Updated to NodeBB v4.3 + New Features

failed to Cross compile Qt 5.6 on RPi 2 (fatal error: bcm_host.h: No such file or directory)

Scheduled Pinned Locked Moved Solved QtonPi
7 Posts 5 Posters 9.4k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    hamed_ta
    wrote on last edited by
    #1

    Hi I try to cross compile Qt 5.6 for RPi 2 by following this tutorial https://wiki.qt.io/RaspberryPi2EGLFS but I got this error

    qeglfsbrcmintegration.cpp:35:22: fatal error: bcm_host.h: No such file or directory
     #include <bcm_host.h>
                          ^
    compilation terminated.
    make[6]: *** [.obj/qeglfsbrcmintegration.o] Error 1
    make[6]: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm'
    make[5]: *** [sub-eglfs_brcm-make_first] Error 2
    make[5]: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration'
    make[4]: *** [sub-deviceintegration-make_first-ordered] Error 2
    make[4]: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms/eglfs'
    make[3]: *** [sub-eglfs-make_first] Error 2
    make[3]: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms'
    make[2]: *** [sub-platforms-make_first] Error 2
    make[2]: Leaving directory `/home/hamed/raspi/qtbase/src/plugins'
    make[1]: *** [sub-plugins-make_first] Error 2
    make[1]: Leaving directory `/home/hamed/raspi/qtbase/src'
    make: *** [sub-src-make_first] Error 2
    

    what's wrong ?

    1 Reply Last reply
    1
    • D Offline
      D Offline
      djunjunjun
      wrote on last edited by djunjunjun
      #2

      I ran into the same problem following the same tutorial. I got it to compile by adding the following include paths in qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf

      INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include
      INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vcos
      INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
      INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
      

      Hope that helps!

      H mr_modoM 2 Replies Last reply
      2
      • D djunjunjun

        I ran into the same problem following the same tutorial. I got it to compile by adding the following include paths in qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf

        INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include
        INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vcos
        INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
        INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
        

        Hope that helps!

        H Offline
        H Offline
        hamed_ta
        wrote on last edited by
        #3

        @djunjunjun Thank you , solved.

        1 Reply Last reply
        0
        • D djunjunjun

          I ran into the same problem following the same tutorial. I got it to compile by adding the following include paths in qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf

          INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include
          INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vcos
          INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
          INCLUDEPATH  += $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
          

          Hope that helps!

          mr_modoM Offline
          mr_modoM Offline
          mr_modo
          wrote on last edited by SGaist
          #4

          @djunjunjun said:

          INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include
          INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include/interface/vcos
          INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
          INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux

          I tried this but found 2 issues with that:

          1. If your are using a Raspberry Pi 2 it needs to go into qtbase/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
          2. Instead of $[QT_SYSROOT] it should be $ $[QT_SYSROOT] - at least otherwise it did not resolve for me.

          That's at least what I needed to get it to compile.

          [edit: Added space between doubled $ signs to show the difference, space must be removed in .pro file SGaist]

          1 Reply Last reply
          2
          • LeoCL Offline
            LeoCL Offline
            LeoC
            wrote on last edited by
            #5

            Hey,

            I now have the exact same problem that I can't compile Qt because bcm_host.h is missing. I also added the lines to my qmake.conf for rp2.
            The file acutally looks like this:

            # qmake configuration for the Raspberry Pi 2
            
            include(../common/linux_device_pre.conf)
            
            QMAKE_LFLAGS           += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
            
            QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
            QMAKE_LIBDIR_EGL        = $$QMAKE_LIBDIR_OPENGL_ES2
            QMAKE_LIBDIR_OPENVG     = $$QMAKE_LIBDIR_OPENGL_ES2
            
            QMAKE_INCDIR_EGL        = $$[QT_SYSROOT]/opt/vc/include
                                      $$[QT_SYSROOT]/opt/vc/include/interface/vcos
                                      $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
                                      $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
            QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
            QMAKE_INCDIR_OPENVG     = $${QMAKE_INCDIR_EGL}
            
            QMAKE_LIBS_EGL          = -lEGL -lGLESv2
            QMAKE_LIBS_OPENVG       = -lEGL -lOpenVG -lGLESv2
            QMAKE_CFLAGS            += -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux
            QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS
            
            DISTRO_OPTS += hard-float
            DISTRO_OPTS += deb-multi-arch
            
            # Preferred eglfs backend
            EGLFS_DEVICE_INTEGRATION = eglfs_brcm
            
            include(../common/linux_arm_device_post.conf)
            
            load(qt_config)
            
            

            The missing file, bcm_host.h, is located at sysroot/opt/vc/include/bcm_host.h
            So, what is wrong here?

            The next thing I don't understand: I have a clean install of Jessie and I have a clean install of Ubuntu 14, running in my virtualbox. Although both systems are new installed, the compilation doesn't work. But I have seen a lot of guys who were able to make a clean installation of Qt on the Pi. How can that be? How is it possible that the installation is working in some cases and in other cases it's not?
            It is very annoying since I already spend several days trying to install Qt on the Pi. I hope anybody can give me the hint I am looking for.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by A Former User
              #6

              Just include the following lines like it was said in the previous threads. This worked for me. I know that this path is also included under QMAKE_INCDIR_EGL, however the below method worked for me. May be you can try this.

              INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include
              INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include/interface/vcos
              INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
              INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux

              and you need to include a $$ before [QT_SYSROOT] in all the links listed above.

              1 Reply Last reply
              0
              • LeoCL Offline
                LeoCL Offline
                LeoC
                wrote on last edited by
                #7

                sorry for my late response, but obviously it was the right thing to do some other stuff in the meantime, because it is working now. Or, at least, the make step was successfull.
                Thanks for that! :)

                When I was looking into my qmake.conf I could see that all the links provided by you are already there, but somehow, I never realized that they have different variable names.
                By default, the links are written in the file with a preceded variable name of "QMAKE_INCDIR_EGL", which is, of course, not the same as "INCLUDEPATH". I don't know why I didn't realized that... anyway, now it's fine.

                1 Reply Last reply
                0

                • Login

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