Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. RPI: Using lib bcm2835 from qt
Qt 6.11 is out! See what's new in the release blog

RPI: Using lib bcm2835 from qt

Scheduled Pinned Locked Moved Solved Installation and Deployment
11 Posts 2 Posters 2.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.
  • D Drazz

    Hello,

    I would like to understand better what I am doing when I install qt cross compile in Ubuntu for Raspbian buster.

    I've installed in my raspberry bcm2835 lib like this:

    tar zxvf bcm2835-1.xx.tar.gz
    cd bcm2835-1.xx
    ./configure
    make
    sudo make check
    sudo make install
    

    I don't know where this lib has installed, but if I run:

    sudo find / bcm2835 | grep bcm2835
    

    I find files in:

    /sys/...
    /usr/include/linux/bcm2835-isp.h
    /usr/src/linux-headers-5.10.17+/....
    /usr/local/include/bcm2835.h
    /usr/local/lib/libbcm2835.a
    /lib/modules/ ....
    

    Now from ubuntu, I run:

    rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/lib sysroot
    rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/include sysroot/usr
    rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/lib sysroot/usr
    rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/opt/vc sysroot/opt
    

    Questions:

    1. Would I be able to #include <bcm2835.h> from Qt Creator in Ubuntu with my raspberry pi kit? The lib is /usr/local/include/bcm2835.h but /usr/local does not get rsync.
    2. Do I have to build again qt-everywhere and install? I have to do it every new lib I add?
    3. Extra: How can I know where make install files are deployed?

    Thank you

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @Drazz

    1. Yes, if you sync your sysroot
    2. No, only if Qt itself requires that lib
    3. You should see that when you call make install. You can also check generated Makefiles

    https://forum.qt.io/topic/113070/qt-code-of-conduct

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

      After doing:

      rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/lib sysroot
      rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/include sysroot/usr
      rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/lib sysroot/usr
      rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/opt/vc sysroot/opt
      

      Qt Creator from Ubuntu does not find <bcm2835.h>

      This is my output when I sudo make install my lib:

      /bin/mkdir -p '/usr/local/lib'
       /usr/bin/install -c -m 644  libbcm2835.a '/usr/local/lib'
       ( cd '/usr/local/lib' && ranlib libbcm2835.a )
       /bin/mkdir -p '/usr/local/include'
       /usr/bin/install -c -m 644 bcm2835.h '/usr/local/include
      

      I've tried this with out success:

      rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/
      

      I have my header in: sysroot/usr/local/include/bcm2835.h

      jsulmJ 2 Replies Last reply
      0
      • D Drazz

        After doing:

        rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/lib sysroot
        rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/include sysroot/usr
        rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/lib sysroot/usr
        rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/opt/vc sysroot/opt
        

        Qt Creator from Ubuntu does not find <bcm2835.h>

        This is my output when I sudo make install my lib:

        /bin/mkdir -p '/usr/local/lib'
         /usr/bin/install -c -m 644  libbcm2835.a '/usr/local/lib'
         ( cd '/usr/local/lib' && ranlib libbcm2835.a )
         /bin/mkdir -p '/usr/local/include'
         /usr/bin/install -c -m 644 bcm2835.h '/usr/local/include
        

        I've tried this with out success:

        rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/
        

        I have my header in: sysroot/usr/local/include/bcm2835.h

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @Drazz You posted before this: /usr/local/include/bcm2835.h
        So, you need to sync /usr/local

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • D Drazz

          After doing:

          rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/lib sysroot
          rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/include sysroot/usr
          rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/lib sysroot/usr
          rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/opt/vc sysroot/opt
          

          Qt Creator from Ubuntu does not find <bcm2835.h>

          This is my output when I sudo make install my lib:

          /bin/mkdir -p '/usr/local/lib'
           /usr/bin/install -c -m 644  libbcm2835.a '/usr/local/lib'
           ( cd '/usr/local/lib' && ranlib libbcm2835.a )
           /bin/mkdir -p '/usr/local/include'
           /usr/bin/install -c -m 644 bcm2835.h '/usr/local/include
          

          I've tried this with out success:

          rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/
          

          I have my header in: sysroot/usr/local/include/bcm2835.h

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @Drazz said in RPI: Using lib bcm2835 from qt:

          I've tried this with out success

          What does this mean? What happened?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Drazz said in RPI: Using lib bcm2835 from qt:

            I've tried this with out success

            What does this mean? What happened?

            D Offline
            D Offline
            Drazz
            wrote on last edited by
            #6

            @jsulm said in RPI: Using lib bcm2835 from qt:

            What does this mean? What happened?

            I've #include <bcm2835.h> in a Qt project. Build fails because It doesn't find the lib.

            jsulmJ 1 Reply Last reply
            0
            • D Drazz

              @jsulm said in RPI: Using lib bcm2835 from qt:

              What does this mean? What happened?

              I've #include <bcm2835.h> in a Qt project. Build fails because It doesn't find the lib.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #7

              @Drazz I was asking about:
              I've tried this with out success:

              rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/

              Som what happened?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Drazz I was asking about:
                I've tried this with out success:

                rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/

                Som what happened?

                D Offline
                D Offline
                Drazz
                wrote on last edited by
                #8

                @jsulm said in RPI: Using lib bcm2835 from qt:

                @Drazz I was asking about:
                I've tried this with out success:
                rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/
                Som what happened?

                Now, In my Ubuntu I have this:

                /opt/qt5pi/sysroot/usr/local/include/bcm2835.h
                /opt/qt5pi/sysroot/usr/local/lib/libbcm2835.a
                

                I open Qt Creator in my Ubuntu, select one random project and add in main.cpp

                #include <bcm2835.h>
                

                Build error:

                ../lifeRaspberry/main.cpp:18:21: fatal error: bcm2835.h: No such file or directory
                 #include <bcm2835.h>
                                     ^
                compilation terminated.
                
                jsulmJ 1 Reply Last reply
                0
                • D Drazz

                  @jsulm said in RPI: Using lib bcm2835 from qt:

                  @Drazz I was asking about:
                  I've tried this with out success:
                  rsync -avz --rsync-path="sudo rsync" pi@192.168.1.60:/usr/local sysroot/usr/
                  Som what happened?

                  Now, In my Ubuntu I have this:

                  /opt/qt5pi/sysroot/usr/local/include/bcm2835.h
                  /opt/qt5pi/sysroot/usr/local/lib/libbcm2835.a
                  

                  I open Qt Creator in my Ubuntu, select one random project and add in main.cpp

                  #include <bcm2835.h>
                  

                  Build error:

                  ../lifeRaspberry/main.cpp:18:21: fatal error: bcm2835.h: No such file or directory
                   #include <bcm2835.h>
                                       ^
                  compilation terminated.
                  
                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @Drazz You should add /usr/local/include folder to the include folders in your pro file. https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  D 1 Reply Last reply
                  1
                  • jsulmJ jsulm

                    @Drazz You should add /usr/local/include folder to the include folders in your pro file. https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

                    D Offline
                    D Offline
                    Drazz
                    wrote on last edited by
                    #10

                    @jsulm said in RPI: Using lib bcm2835 from qt:

                    @Drazz You should add /usr/local/include folder to the include folders in your pro file. https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

                    Worked.

                    Final thought... why do I have to include the path? Does libraries that are in sysroot/usr/include need to include path?
                    If I rsync my raspberry pi /usr/local with my ubuntu sysrooot/usr, I would be able to quit that INCLUDE path from my .pro?

                    Thanks a lot for you time.

                    jsulmJ 1 Reply Last reply
                    0
                    • D Drazz

                      @jsulm said in RPI: Using lib bcm2835 from qt:

                      @Drazz You should add /usr/local/include folder to the include folders in your pro file. https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

                      Worked.

                      Final thought... why do I have to include the path? Does libraries that are in sysroot/usr/include need to include path?
                      If I rsync my raspberry pi /usr/local with my ubuntu sysrooot/usr, I would be able to quit that INCLUDE path from my .pro?

                      Thanks a lot for you time.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @Drazz /usr is automatically searched by tools like compiler. But /usrLocal is not, so you have to tell the compiler to also look there.
                      "If I rsync my raspberry pi /usr/local with my ubuntu sysrooot/usr, I would be able to quit that INCLUDE path from my .pro?" - if you sync to /usr instead of /usr/local then there is no need to add anything to include paths.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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