2000-12-30 17:54:09

by Sourav Sen

[permalink] [raw]
Subject: Whats the problem


I am unable to compile the following code, can anyone say whats the
problem :

The main error msg is like the following:

parse error before `EXPORT_SYMTAB_not_defined'
warning: type defaults to `int' in declaration of
`EXPORT_SYMTAB_not_defined'
warning: data definition has no type or storage class

==================================
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/unistd.h>
#include <linux/modversions.h>

int init_module()
{
printk("Hello, World\n");
return 0 ;
}

int show_mystate(void)
{
unsigned long state ;
state = current->state ;
printk("%x\n",state);
return 0 ;
}

EXPORT_SYMBOL(show_mystate);

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

=============================================
The makefile

CC=gcc
MODCFLAGS=-Wall -DMODULE -D__KERNEL__ -DLINUX

showinfo.o : showinfo.c

$(CC) $(MODCFLAGS) -c showinfo.c


Thanks
Sourav
--------------------------------------------------------------------------------
SOURAV SEN MSc(Engg.) CSA IISc BANGALORE URL : www2.csa.iisc.ernet.in/~sourav
ROOM NO : N-78 TEL :(080)309-2454(HOSTEL) (080)309-2906 (COMP LAB)
--------------------------------------------------------------------------------



2000-12-31 16:28:24

by Jan-Benedict Glaw

[permalink] [raw]
Subject: Re: Whats the problem

On Sat, Dec 30, 2000 at 10:46:04PM +0530, Sourav Sen wrote:
>
> I am unable to compile the following code, can anyone say whats the
> problem :
>
> The main error msg is like the following:
>
> parse error before `EXPORT_SYMTAB_not_defined'
^^^^^^^^^^^^^^^^^^^^^^^^^

Well, the problem is that 'EXPORT_SYMTAB' is not defined;)
>
> CC=gcc
> MODCFLAGS=-Wall -DMODULE -D__KERNEL__ -DLINUX

should be:

MODCFLAGS=-Wall -DMODULE -DEXPORT_SYMTAB -D__KERNEL__ -DLINUX

MfG, JBG

--
Fehler eingestehen, Gr??e zeigen: Nehmt die Rechtschreibreform zur?ck!!!
/* Jan-Benedict Glaw <[email protected]> -- +49-177-5601720 */
keyID=0x8399E1BB fingerprint=250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB
"insmod vi.o and there we go..." (Alexander Viro on linux-kernel)


Attachments:
(No filename) (795.00 B)
(No filename) (240.00 B)
Download all attachments