Score:1

I found an error message says that there is no such file or directory "linux/slab.h" but is there

mc flag

I was installing CP210x drivers on my Ubuntu 22.04. In its instruction, the first step was to run make cp210x on Terminal windows. But, while executing it, there was an error message said that linux/slab.h was not found. Here is the screenshot

I had tried steps which were said to be the resolution of this problem

First, I tried installing the linux-headers package for my current kernel version by running these commands on the Terminal window.

  1. uname -r" on the terminal
  2. sudo apt-get install linux-headers-$(uname -r)
  3. make cp210x" again.

Second, from another source, (in this case the file err.h that not found, but I thought it would work since those files are from the same /linux directory) it was said that I needed the package linux-libc-dev.

  1. sudo apt-get update
  2. sudo apt-get install linux-libc-dev linux-headers-generic

But all resolutions above didn't resolve anything, I was just the same before I tried to do those steps. What should I do? Is there any sollutions?

Things that might help you to find a solution or recommendation:

  • I installed Arduino 2.0.4 via AppImage on Ubuntu 2.0.4
  • I have also installed esp32 2.0.7 by Expressif Systems
ArrayBolt3 avatar
ls flag
Are you absolutely sure that there actually is a file at /usr/include/linux/slab.h? That file doesn't exist on my system either. You may want to check the kernel version that the driver is designed for and compare it with the kernel version you're running, as drivers designed only for older kernels will frequently not work properly on newer kernels.
hr flag
This appears to be a kernel module, so you should probably just type `make` rather than `make cp210x` - that will cause it to run a command relative to the kernel source tree, like `make -C /lib/modules/$(uname -r)/build M=/home/username/src/cp210x modules` rather than a simple `cc ... -o` command.
hr flag
... although having said that, it looks like the first link may only support kernel versions 2.x thru 4.x
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.