How use raspberrypi-kernel-headers in Qt
-
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? -
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?@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 -
@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 -
@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
-
@zhmh And are those header files located in that folder?
Like /usr/src/linux-headers-5.13.0-30-generic/linux/hrtimer.h