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. path of bcm2835 library after install it in linux
Forum Updated to NodeBB v4.3 + New Features

path of bcm2835 library after install it in linux

Scheduled Pinned Locked Moved Solved QtonPi
10 Posts 2 Posters 5.1k 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.
  • C Offline
    C Offline
    carter_james
    wrote on last edited by
    #1

    hello people, I have installed in linux bcm2835 library of pi2
    I need the path of the installed library for the integrating into qt creator denn i make a cross-compilling.
    i done this: sudo find / -name bcm2835* but do not help me

    1 Reply Last reply
    0
    • sneubertS Offline
      sneubertS Offline
      sneubert
      wrote on last edited by
      #2

      if you did make installthere is a libbcm2835.ain /usr/local/lib and a bcm2835.h in /usr/local/include
      I guess you used this guid (https://wiki.qt.io/RaspberryPi2EGLFS) for cross build qt . If so, you have to copy the libbcm2835.a from /usr/local/lib to /usr/lib and the bcm2835.h from /usr/local/include to /usr/include and rsync your sysroot again.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        carter_james
        wrote on last edited by
        #3

        yes i used that guid (https://wiki.qt.io/RaspberryPi2EGLFS)
        yes i did make install
        yes i looked libbcm2835.a is in /usr/local/lib and a bcm2835.h is in /usr/local/include
        that mean i only need to rsync bcm2835.h und bcm2835.a like you say and write this in Qtcreator
        projektname dann right click/add library/extern library
        library file=~/raspi/sysroot
        include path=~/raspi/sysroot
        is it true?

        1 Reply Last reply
        0
        • sneubertS Offline
          sneubertS Offline
          sneubert
          wrote on last edited by sneubert
          #4

          after rsync you can include the header with #include <bcm2835.h> in your project without the need of adding an extra header path. Also you dont need to specify an linker path. Just add LIBS += -llibbcm2835 to your .pro file.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            carter_james
            wrote on last edited by
            #5

            that mean i do this :

            1. copy the libbcm2835.a from /usr/local/lib to /usr/lib and the bcm2835.h from /usr/local/include to /usr/include and rsync your sysroot again.

            2. rsync -avz pi@IP:/lib sysroot
              rsync -avz pi@IP:/usr/include sysroot/usr
              rsync -avz pi@IP:/usr/lib sysroot/usr
              rsync -avz pi@IP:/opt/vc sysroot/opt

            3. -header file #include <bcm2835.h>
              -.pro file add LIBS += -llibbcm2835

            1 Reply Last reply
            0
            • sneubertS Offline
              sneubertS Offline
              sneubert
              wrote on last edited by sneubert
              #6

              exactly! And keep in mind, that using bcm283 lib requires to run your program with root privilege. If your running your program from qt creator with pi user it will cause an access denied error. You can either run the deployed program with sudo on your pi directly or enable root for ssh and use the root to start the debug session from qt creator.

              C 1 Reply Last reply
              0
              • sneubertS sneubert

                exactly! And keep in mind, that using bcm283 lib requires to run your program with root privilege. If your running your program from qt creator with pi user it will cause an access denied error. You can either run the deployed program with sudo on your pi directly or enable root for ssh and use the root to start the debug session from qt creator.

                C Offline
                C Offline
                carter_james
                wrote on last edited by
                #7

                @sneubert :i get this two error after build
                cannot find -llibbcm2835
                ld returned 1 exit status

                1 Reply Last reply
                0
                • sneubertS Offline
                  sneubertS Offline
                  sneubert
                  wrote on last edited by
                  #8

                  sorry try -lbcm2835

                  1 Reply Last reply
                  1
                  • C Offline
                    C Offline
                    carter_james
                    wrote on last edited by
                    #9

                    thanks it work

                    1 Reply Last reply
                    0
                    • sneubertS Offline
                      sneubertS Offline
                      sneubert
                      wrote on last edited by
                      #10

                      please mark thread as solved

                      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