执行 make 时出现“*** [all] Error 2”错误

执行 make 时出现“*** [all] Error 2”错误

我正在尝试增加我的 wifi 信号强度,并在尝试进行以下操作时出现此代码:

spectre@spectre-HP-Stream-Notebook-PC-13:~/Desktop/rtlwifi_new-master$ make
make -C /lib/modules/4.15.0-36-generic/build M=/home/spectre/Desktop/rtlwifi_new-master modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-36-generic'
  CC [M]  /home/spectre/Desktop/rtlwifi_new-master/base.o
cc1: error: code model kernel does not support PIC mode
scripts/Makefile.build:332: recipe for target '/home/spectre/Desktop/rtlwifi_new-master/base.o' failed
make[2]: *** [/home/spectre/Desktop/rtlwifi_new-master/base.o] Error 1
Makefile:1551: recipe for target '_module_/home/spectre/Desktop/rtlwifi_new-master' failed
make[1]: *** [_module_/home/spectre/Desktop/rtlwifi_new-master] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-36-generic'
Makefile:58: recipe for target 'all' failed
make: *** [all] Error 2

我也已经安装了linux-headers-4.15.0-36-genericmake。有谁能给我一些建议,因为我已经有一段时间没用过 Ubuntu 了?

答案1

我刚刚rtlwifi_new-master.zip这里并做了制作,一切运行正常。

我怀疑您可能没有阅读过 README.md 文件,其中调用了一些先决条件应用程序,所以......

sudo apt-get install linux-headers-generic build-essential git dkms

还要注意,这是一个dkms驱动程序,因此正确的安装方法是安装陣容, 然后做...

sudo cp {the source code folder} to /usr/src
sudo dkms add...
sudo dkms build...
sudo dkms install...
dkms status

输入man dkms以获得帮助。

相关内容