Hi,
I am getting linker errors when i compile 3 modules as given below
The module layout is as below
Rules for compilation :Code:Z.h { int s; void B(); } Z.c { int s = 1; void B() { statements; } } Y.c{ A() { if (s) B(); } X.cpp{ extern int s; s=0; A(); }
Z : Y Z.h
cc -o Z Y
Y.o : Z.h Y.c
cc -c -o Y.o Y.c
Z : Z.h Z.c
cc -c -o Z.c
Y : Y.o Z
cc -o Y Y.o Z
I get a linker error when i compile the modules as follows
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x1: In functi
n `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
Y.o(.text+0x1e3): In function `makedist':
: undefined reference to `rint'
Y.o(.text+0x2e6): In function `inverttable':
: undefined reference to `rint'
Y.o(.text+0x312): In function `inverttable':
: undefined reference to `rint'
collect2: ld returned 1 exit status
make: *** [Y] Error 1
Please help....
Regards,
Shashidhara