Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't compile the TPLINK TL-WN822N driver under Linux Mint 19.1 XFCE

I have an USB wifi adapter (TPLINK TL-WN822N. I downloaded the linux driver from the manufacturers download page and tried to compile it, but I always get errors when I try to run the make command.

I have a Linux Mint 19.1 with XFCE desktop. The uname -a gives the followings:

  • Linux user-HomePC 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

My opinion is that the problem is caused by the gcc version.

I also have an LXLE linux installed in an old PC and the driver compilation can be done without any errors. And the installed driver is working perfectly.

  • The Linux Mint has a gcc version: gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) make version: GNU Make 4.1

  • The Linux LXLE has a gcc version: gcc version 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) make version: GNU Make 4.1

When I start the make command I get the following messages:


make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.15.0-47-generic/build M=/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047  modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-47-generic'
  CC [M]  /home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/core/rtw_cmd.o
In file included from /home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/osdep_service.h:47:0,
                 from /home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/drv_types.h:27,
                 from /home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/core/rtw_cmd.c:17:
/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/osdep_service_linux.h: In function ‘_init_timer’:
/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/osdep_service_linux.h:299:8: error: ‘_timer {aka struct timer_list}’ has no member named ‘data’
  ptimer->data = (unsigned long)cntx;
        ^~
/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/include/osdep_service_linux.h:300: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/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/core/rtw_cmd.o' failed
make[2]: *** [/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047/core/rtw_cmd.o] Error 1
Makefile:1552: recipe for target '_module_/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047' failed
make[1]: *** [_module_/home/user/Asztal/rtl8192EU_WiFi_linux_v5.2.19.1_25633.20171222_COEX20171113-0047] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-47-generic'
Makefile:1828: recipe for target 'modules' failed
make: *** [modules] Error 2

If I am right, and the problem is caused by the newer gcc version, then is there a way to use another version of gcc for casual compilation?

If something else is the problem, what could it be?

I am new in the Linux platform, and may be the answer is so profane, but some help would be really appreciated.

ps. And sorry for my English, is not my mother language ;

like image 280
alexfeltoti Avatar asked Dec 06 '25 16:12

alexfeltoti


1 Answers

At least I found the solution with a little help. Here is what I did to get working my USB wifi adapter after system restart:

  1. Check for updates: sudo apt update
  2. Install the git: sudo apt install git
  3. Download the driver from github: git clone https://github.com/jeremyb31/rtl8192eu-linux-driver
  4. Change to the driver directory: cd rtl8192eu-linux-driver
  5. Compile the driver for your kernel: make
  6. Install the driver into the system: sudo make install
  7. Load the driver: sudo modprobe 8192eu

But the procedure is not finished here, because the system will use the originally installed driver, so we have to blacklist it:

  1. open the corresponding file: sudo nano /etc/modprobe.d/realtek.conf
  2. insert the blacklist option into the file: blacklist rtl8xxxu
  3. save the file and exit
  4. restart the system

Now it should work in the proper way. For me it worked.

Hope, it will help to someone...

like image 57
alexfeltoti Avatar answered Dec 10 '25 13:12

alexfeltoti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!