I wrote a C program pgm.c. It contains a function readfile.so. Also I wrote a header file do.h. Then I wrote this readfile function in a separate program ini.c and included do.h to this program too. When I compiled pgm.c I got the error "pgm.c:(.text+0x2e): undefined reference to readfile"
My codes are :
do.h
    extern int readfile( FILE *in );
pgm.c
    #include<stdio.h>
    #include"do.h"
    int main(int argc,char **argv)
    {
     FILE *in;
     in=fopen(argv[1],"r");
     readfile(in);
    }
ini.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <limits.h>
    #include <math.h>
    #include <float.h> 
    #include"do.h"
    int c;
    int readfile( FILE *in )
    {
    while( c == '#' || c == '\n' )  
    {
      if( c == '#' ) 
       {
        while( ( c = getc(in) ) != '\n' );
       }
      if( c == '\n' ) 
       c = getc( in ); 
     }
      if( c == EOF )
      break;
      else
      {
      printf("hai");
      }
    }
    return 1;
    }
Is there any error in my programs?
compiling by gcc pgm.c
 
     
     
    