Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How use raspberrypi-kernel-headers in Qt
QtWS25 Last Chance

How use raspberrypi-kernel-headers in Qt

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 433 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.
  • Z Offline
    Z Offline
    zhmh
    wrote on 24 Feb 2022, 09:19 last edited by zhmh
    #1

    I cross compile Qt for raspi with this manual and now I want to use kernel headers in my cmake project ,such as :

    #include <linux/hrtimer.h>
    #include <linux/interrupt.h>
    #include <linux/ktime.h>
    #include <linux/tty_flip.h>
    

    But it says no such file or directory found.
    How can I use kernel headers in my code? can I add headers address to CmakeLists.txt?

    J 1 Reply Last reply 24 Feb 2022, 10:26
    0
    • Z zhmh
      24 Feb 2022, 09:19

      I cross compile Qt for raspi with this manual and now I want to use kernel headers in my cmake project ,such as :

      #include <linux/hrtimer.h>
      #include <linux/interrupt.h>
      #include <linux/ktime.h>
      #include <linux/tty_flip.h>
      

      But it says no such file or directory found.
      How can I use kernel headers in my code? can I add headers address to CmakeLists.txt?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 24 Feb 2022, 10:26 last edited by
      #2

      @zhmh This has nothing to do with Qt.
      You need to tell CMake where to look for include folders: https://cmake.org/cmake/help/latest/command/include_directories.html

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

      Z 1 Reply Last reply 24 Feb 2022, 11:02
      0
      • J jsulm
        24 Feb 2022, 10:26

        @zhmh This has nothing to do with Qt.
        You need to tell CMake where to look for include folders: https://cmake.org/cmake/help/latest/command/include_directories.html

        Z Offline
        Z Offline
        zhmh
        wrote on 24 Feb 2022, 11:02 last edited by
        #3

        @jsulm I add

        include_directories(/usr/src/linux-headers-5.13.0-30-generic/)
        

        in my CmakeLists.txt file but still not found include headers

        J 1 Reply Last reply 24 Feb 2022, 11:04
        0
        • Z zhmh
          24 Feb 2022, 11:02

          @jsulm I add

          include_directories(/usr/src/linux-headers-5.13.0-30-generic/)
          

          in my CmakeLists.txt file but still not found include headers

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 24 Feb 2022, 11:04 last edited by
          #4

          @zhmh And are those header files located in that folder?
          Like /usr/src/linux-headers-5.13.0-30-generic/linux/hrtimer.h

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

          Z 1 Reply Last reply 5 Mar 2022, 04:42
          0
          • J jsulm
            24 Feb 2022, 11:04

            @zhmh And are those header files located in that folder?
            Like /usr/src/linux-headers-5.13.0-30-generic/linux/hrtimer.h

            Z Offline
            Z Offline
            zhmh
            wrote on 5 Mar 2022, 04:42 last edited by
            #5

            @jsulm I make mistake it's on /usr/src/linux-headers-5.13.0-30-generic/linux/include/hrtimer.h

            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