Error when running the make command

Hi,
Not really sure whether this question should go to this forum but am giving it a shot.

I have compiled a simple C program test.c.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int a;
int test()
{
a=a+1;
return a;
}

When I run a make command, I get this:

--- This is the command -----
$ /usr/ccs/bin/make -f demo_rdbms.mk extproc_nocallback SHARED_LIBNAME=test.so OBJS=test.o
-----------------------------------

-----Output ---------------------

/usr/ccs/bin/ld -G -z text -L/u01/app/oracle/product/9.0.1/lib -R/u01/app/oracle
/product/9.0.1/lib -o test.so test.o
Text relocation remains referenced
against symbol offset in file
a 0x4 test.o
a 0x8 test.o
a 0xc test.o
a 0x10 test.o
a 0x20 test.o
a 0x24 test.o
ld: fatal: relocations remain against allocatable but non-writable sections
*** Error code 1
make: Fatal error: Command failed for target `extproc_nocallback'

------------------------------------

I am using Sun Solaris 2.8.

Can anyone pl suggest what might be wrong.
Thanx

you need to compile it with the 'cc' command.
so youd type
cc test.c

however iwould suggest naming the program something other than test, because there already exists a command 'test'. you can keep the name as test if youd like, but you will need to make sure you have the ./ infront of the command ./test. but if you just use the command cc test.c it is ok, the binary will be there as a.out and not test, unless you specify it.

test() is not an entry point for the executable.

you must call it main() if you intend to run it as an executable. otherwise, include the header file for test (test.h) in your main program and call the function from there.