mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dhirendra Pal Singh <list@actiswitch.com>
To: linux-kernel@vger.kernel.org
Subject: Problem in EXPORT_SYMBOL.. Please Help!
Date: Tue, 24 Dec 2002 08:20:41 -0800	[thread overview]
Message-ID: <3E088959.60000@actiswitch.com> (raw)

Hi All
I am trying to resolve the problem of EXPORT_SYMBOL. I have raised this 
question on newbies kernel list but no one replied. Hence I am posting 
it here.
I am using kernel 2.4.18-14. Below is the listing of a simple test code.

**************************************
/*main.c*/

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

#if CONFIG_MODVERSION == 1
#define MODERVSION
#include <linux/modversions.h>
#endif

int print_func()
{
	printk("Entry point.\n");
	return 0;
}

EXPORT_SYMBOL(print_func);

int init_module()
{
	print_func();
	return 0;
}

void cleanup()
{
	printk("End of story.\n");
}

********************************************

********************************************
/*Makefile*/

export-objs	:= main.o
CC=gcc
MAKE = make
KERNELDIR = /usr/src/linux-2.4.18-14
MODCFLAGS := --save-temps -Wall -D__KERNEL__ -DMODULE -DLINUX -DMODVERSIONS

main.o:		main.c 
		$(CC) $(MODCFLAGS) -I$(KERNELDIR)/include -c main.c

clean:
	rm -fr *.o *.i *.s

***********************************************

And on compiling the error is as follows...

gcc --save-temps -Wall -D__KERNEL__ -DMODULE -DLINUX -DMODVERSIONS -I/usr/src/linux-2.4.18-14/include -c main.c
main.c:15: parse error before "this_object_must_be_defined_as_export_objs_in_the_Makefile"
main.c:15: warning: type defaults to `int' in declaration of `this_object_must_be_defined_as_export_objs_in_the_Makefile'
main.c:15: warning: data definition has no type or storage class

The error says export_ojbs must be defined. As you can see I have already defined them in the Makefile. 

Pleaes help. I am kind of stucked in my project.

Thanks in advance..
Dp

make: *** [main.o] Error 1





             reply	other threads:[~2002-12-24 16:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-24 16:20 Dhirendra Pal Singh [this message]
2002-12-25 15:33 ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E088959.60000@actiswitch.com \
    --to=list@actiswitch.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome