make: *** /lib/modules/2.6.32-573.7.1.el6.x86_64/build/: No such file or directory. Stop.

时间:2022-09-08 12:12:40

开发环境:centos6.5

编译驱动时输出错误信息

make: *** /lib/modules/2.6.32-573.7.1.el6.x86_64/build/: No such file or directory.  Stop.

解决方法:

1、安装内核开发包

[monster@localhost ~]$ sudo yum install -y kernel-devel kernel-headers

2、重新创建符号链接

[monster@localhost ~]$ ln -s /usr/src/kernels/2.6.32-573.7.1.el6.x86_64/ /lib/modules/2.6.32-431.el6.x86_64/build 
[monster@localhost ~]$ ll /lib/modules/2.6.32-431.el6.x86_64/build
lrwxrwxrwx 1 root root 43 10月 20 17:33 /lib/modules/2.6.32-431.el6.x86_64/build -> /usr/src/kernels/2.6.32-573.7.1.el6.x86_64/