LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2024, 05:02 AM   #1
Beta2024
LQ Newbie
 
Registered: Jan 2024
Posts: 3

Rep: Reputation: 0
Red face Makifile ***/lib/modules/5.10.168.... no such file or directory


Hello,
I am newbie, and I got a problem with make file in Linux, please help me.
My makefile as below:
obj-m += helloMod.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

And I got Error:
make[1]: *** /lib/modules/5.10.168-ti-r71/build: No such file or directory. Stop.

I stuck right here, please help me, thanks a lot!
 
Old 01-17-2024, 01:51 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Have you reviewed the path to see what actually exists?
 
Old 01-17-2024, 11:37 PM   #3
Beta2024
LQ Newbie
 
Registered: Jan 2024
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by grail View Post
Have you reviewed the path to see what actually exists?
I checked the path, and I see I don't have build folder in 5.10.168-ti-r71.
Please take a look in the picture I attached.
What should I do?

Thank you.
Attached Thumbnails
Click image for larger version

Name:	MakefileProblem.png
Views:	10
Size:	40.4 KB
ID:	42431  
 
Old 01-18-2024, 04:01 AM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,796

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
I would create the missing "build" directory.
On the command line with mkdir or sudo mkdir
 
Old 01-18-2024, 05:13 AM   #5
lvm_
Member
 
Registered: Jul 2020
Posts: 927

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
Quote:
Originally Posted by MadeInGermany View Post
I would create the missing "build" directory.
I wouldn't - this is where kernel headers are expected to be, it is meaningless without its contents. You should install the appropriate linux-headers package.
 
1 members found this post helpful.
Old 01-18-2024, 06:56 AM   #6
Beta2024
LQ Newbie
 
Registered: Jan 2024
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lvm_ View Post
I wouldn't - this is where kernel headers are expected to be, it is meaningless without its contents. You should install the appropriate linux-headers package.
Thanks a lot.
I found my problem.
I already install kernel headers, but it exists in usr/src/linux-headers-5.1-.168-ti-r71.

I have 2 ways to resolve my problem.
1. Change the path in Makefile to: make -C /usr/src/linux-headers-5.1-.168-ti-r71 M=$(PWD) modules
2. Create a symbol: ln -s /usr/src/linux-headers-5.1-.168-ti-r71/ /lib/linux-headers-5.1-.168-ti-r71/build

Thanks all!!!
 
Old 01-19-2024, 01:10 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Glad you got there Please remember to mark question as SOLVED
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot load /usr/lib/apache2/modules/mod_ssl.so into server: libssl.so.1.0.0: cannot open shared object file: No such file or directory RayinTampa Linux - Newbie 3 10-11-2019 10:34 AM
What route to access daisy chained 2d router 192.168.1.1 after 192.168.0.1 (subnets?) Emmanuel_uk Linux - Networking 6 05-05-2006 01:47 AM
FATAL: Could not load /lib/modules/2.6.14-default/modules.dep no such file exist dr_zayus69 Linux - Software 3 12-26-2005 06:44 PM
Is someone on my network?! ::ffff:192.168.0.10:ssh ::ffff:192.168.0.:38201 ESTABLISHE ming0 Linux - Security 4 04-12-2005 01:04 AM
192.168.2.1 network with 192.168.0.1? Micro420 Linux - Networking 2 02-27-2005 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration