Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7188859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:10:36+00:00 2026-05-28T19:10:36+00:00

I am unable to compile a linux kernel module, Given the following source: /*

  • 0

I am unable to compile a linux kernel module,

Given the following source:

/* hello.c */

#include <linux/module.h>
#include <linux/kernel.h>

int init_module(void)
{
printk(KERN_INFO "Hello world\n");
return 0;
}

void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world\n");
}

/* end of hello.c */

and the following Makefile:

obj-m += hello.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

When I type make while in the same directory as the source and make files, I get the message: ‘Nothing to be done for `all’
The compilation seems to stop here and no object file is created.

Now just for testing, I tried a new simpler Makefile:
TARGET := hello
${TARGET}.o: ${TARGET}.c

Running make gives me the new error:hello.c:1: fatal error: linux/module.h: No such file or directory.

however this file IS available in the folder:

/usr/src/linux-headers-2.6.35-22/include/linux 

and also in

/usr/src/linux-headers-2.6.35-22-generic/include/linux

as is the kernel.h file

What am I missing, any ideas?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:10:37+00:00Added an answer on May 28, 2026 at 7:10 pm

    You are missing a tab between the start of the line and “make -C …”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I compile my application , I get following compile error. Unable to find
I am unable to compile the following Flex application. All I am trying to
I wrote some code but I am unable to compile it: #include <cstdio> #include
I'm running Fedora 14 64 bits. I cloned the kernel source tree from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
I am trying to compile Linux source but always get qt missing, here is
#include <stdio.h> #include <inttypes.h> int main(void) { int8_t int8; int16_t int16; int32_t int32; int64_t
I am getting an exception in Tomcat stating the following: org.apache.jasper.JasperException: Unable to compile
I'm trying to compile a Python binding, but I'm unable to find the python.h
I'm trying to use Cocotron to compile for Linux in Xcode. Everything's working great
I'm referencing the NHibernate dll version 2.1.2-GA, and am unable to compile under Mono

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.