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
Forum Updated to NodeBB v4.3 + New Features

How use raspberrypi-kernel-headers in Qt

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 445 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.
  • zhmhZ Offline
    zhmhZ Offline
    zhmh
    wrote on 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?

    jsulmJ 1 Reply Last reply
    0
    • zhmhZ zhmh

      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?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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

      zhmhZ 1 Reply Last reply
      0
      • jsulmJ jsulm

        @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

        zhmhZ Offline
        zhmhZ Offline
        zhmh
        wrote on 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

        jsulmJ 1 Reply Last reply
        0
        • zhmhZ zhmh

          @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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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

          zhmhZ 1 Reply Last reply
          0
          • jsulmJ jsulm

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

            zhmhZ Offline
            zhmhZ Offline
            zhmh
            wrote on 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