Installing Realtek Wireless Driver Kernel 6.14.0-13

I’m trying to compile the wireless driver located here GitHub - biglinux/rtl8831: realtek 8851 8831 linux driver

When I run sudo make I get the following output

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.14.0-13-generic/build M=/home/brian/rtl8831-main modules
make[1]: Entering directory ‘/usr/src/linux-headers-6.14.0-13-generic’
make[2]: Entering directory ‘/home/brian/rtl8831-main’
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-14 (Ubuntu 14.2.0-19ubuntu1) 14.2.0
You are using: gcc-14 (Ubuntu 14.2.0-19ubuntu2) 14.2.0
CC [M] platform/platform_ops.o
platform/platform_ops.c:15:10: fatal error: drv_types.h: No such file or directory
15 | #include <drv_types.h>
| ^~~~~~~~~~~~~
compilation terminated.
make[4]: *** [/usr/src/linux-headers-6.14.0-13-generic/scripts/Makefile.build:207: platform/platform_ops.o] Error 1
make[3]: *** [/usr/src/linux-headers-6.14.0-13-generic/Makefile:1999: .] Error 2
make[2]: *** [/usr/src/linux-headers-6.14.0-13-generic/Makefile:251: __sub-make] Error 2
make[2]: Leaving directory ‘/home/brian/rtl8831-main’
make[1]: *** [Makefile:251: __sub-make] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-6.14.0-13-generic’
make: *** [Makefile:827: modules] Error 2

I confirmed the drv_types.h does exist in the header directory

I’m on Ubuntu 25.04 beta and I know this driver compiles on Kernel 6.12

Can someone tell me how to resolve the error please

Don’t know if this is really your problem but you may check the following:

#include <drv_types.h> looks in a standard list of system directories as mentioned in #include Syntax.

I confirmed the drv_types.h does exist in the header directory

Can you check that this header directory is included in the standard list of system directories. Or you can add your directory using the option in above link. Or you can try changing to a user include like #include "drv_types.h"

Hello,

Yes the headers directory also exist is /usr/include. I appreciate the help do you have any other ideas?

Did you try the proposed steps in 2nd post?

Guess the initial post is yours. And you had the same error with the previous kernel. Just want to make sure it’s not the same problem with same solution.

Aren’t you supposed to run make without sudo and then run sudo make install?

See section Manually install

Adding sudo doesn’t change the process or output in this case but your riht it is not needed in this case just habit.

Did you try it? According to sudo manpage environment variables and home may change …

I think what you are referring to is sudo -i which gives you super privileges as the actual user named root. As for the wireless driver issue it seems to be a problem with the make seeing the include file it is in the proper directory. I have considered changing the makefile but wouldn’t know where and what to change in the file

No.

See my first post in this thread

One last question: did you try make without sudo? (All your replies have been evasive.)

Yes I have tried make both with and without sudo with the same results. I’m not understanding what you want me to do with the include can you post commands step by step please?

This is the directory where you downloaded from github. Right? I think the drv_types.h is supposed to be in the sub folder include. Can you check that?

Yes confirmed drv_types.h does exist in /home/brian/rtl8831-main/include just not sure how to tell gcc that it is there.

It would be possible to alter the source file to use exactly this file in this location. But perhaps if going this way this has to be done for more source files…
As far as I understand the Makefile (never used make before!) it should pass the ‘include’ directory as an argument to gcc. But I do not know why this does not work.

What do you get running make clean?

I downloaded from github myself. Had to adapt two source files to match my headers (some difference based on kernel version). But after that everything compiles. No problems with missing header files yet (compiling while typing).

I suggest you remove (or rename) the complete folder rtl8831-main. Then do a fresh download from github and run make.

This is the output of make clean

make clean
cd phl ; rm -fr ////.mod.c ////.mod ////.o ////..cmd ////.ko
cd phl ; rm -fr //
/.mod.c ///.mod ///.o ///..cmd ///.ko
cd phl ; rm -fr //
.mod.c //.mod //.o //..cmd //.ko
cd phl ; rm -fr /.mod.c /.mod /.o /..cmd /.ko
cd phl ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd core ; rm -fr /.mod.c /.mod /.o /..cmd /.ko
cd core ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd os_dep/linux ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd os_dep/linux/hwsim ; rm -fr *.mod.c *.mod .o ..cmd *.ko
/bin/sh: 1: cd: can’t cd to os_dep/linux/hwsim
cd os_dep ; rm -fr *.mod.c *.mod .o ..cmd *.ko
cd platform ; rm -fr *.mod.c *.mod .o ..cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod .o ..cmd *.ko *~
rm -fr .tmp_versions

You can try make again. But as I wrote before I think it would be better to start with a fresh git clone.

A fresh git clone and make still gives the sane error

The git repository seems to be ok (worked for me). I guess there must be something in settings of make or/and gcc. Or there is an issue with environment variables.

Found this reported bug. Maybe it affects you, too.

You may try

  • sudo apt-get update
  • sudo apt-get upgrade

then reboot