make: *** [modules] 尝试安装 rtl8723de 驱动程序时出现错误 2

make: *** [modules] 尝试安装 rtl8723de 驱动程序时出现错误 2

我正在尝试在我的 Ubuntu 18.04、内核 14.5 和 hp 笔记本电脑中安装 wifi 驱动程序。

我运行了以下命令:

sudo apt-get install build-essential dkms
wget -d -c -O 'rtl8723de.zip' https://github.com/smlinux/rtl8723de/archive/4.11-up.zip
unzip rtl8723de.zip
cd rtl8723de
make

make在终端中得到这个输出后:

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.15.0-22-generic/build M=/home/praveen/rtl8723de  modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-22-generic'
Makefile:976: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  CC [M]  /home/praveen/rtl8723de/core/rtw_cmd.o
In file included from /home/praveen/rtl8723de/include/osdep_service.h:42:0,
                 from /home/praveen/rtl8723de/include/drv_types.h:32,
                 from /home/praveen/rtl8723de/core/rtw_cmd.c:22:
/home/praveen/rtl8723de/include/osdep_service_linux.h: In function ‘_init_timer’:
/home/praveen/rtl8723de/include/osdep_service_linux.h:287:8: error: ‘_timer {aka struct timer_list}’ has no member named ‘data’
  ptimer->data = (unsigned long)cntx;
        ^~
/home/praveen/rtl8723de/include/osdep_service_linux.h:288:2: error: implicit declaration of function ‘init_timer’; did you mean ‘_init_timer’? [-Werror=implicit-function-declaration]
  init_timer(ptimer);
  ^~~~~~~~~~
  _init_timer
cc1: some warnings being treated as errors
scripts/Makefile.build:332: recipe for target '/home/praveen/rtl8723de/core/rtw_cmd.o' failed
make[2]: *** [/home/praveen/rtl8723de/core/rtw_cmd.o] Error 1
Makefile:1552: recipe for target '_module_/home/praveen/rtl8723de' failed
make[1]: *** [_module_/home/praveen/rtl8723de] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-22-generic'
Makefile:1884: recipe for target 'modules' failed
make: *** [modules] Error 2

我该如何解决这个问题?

答案1

首先,删除无法操作的文件:

sudo rm -r rtl8723de*

接下来,安装另一个先决条件:

sudo apt update && sudo apt -y install git

现在克隆一个更好的文件:

git clone https://github.com/lwfinger/rtlwifi_new.git

现在构建驱动程序:

cd rtlwifi_new
make
sudo make install
sudo modprobe rtl8723de

你的无线网络现在应该可以正常工作了。

编辑:当 Update Manager 安装较新的内核版本(也称为 linux-image)时,在请求的重新启动后,重新编译:

cd ~/rtlwifi_new
make clean
git pull
make
sudo make install
sudo modprobe rtl8723de

答案2

显然,您下载的代码无法编译,因为timer_list您计算机上的数据结构与源代码中使用的数据结构不匹配。您下载的驱动程序似乎与您的内核不匹配(而且给我们的内核版本不正确。uname -r请给您正确的内核版本)。

我没有办法给你,但你看到了吗这一页

相关内容