title: Error : multiple definition
body: <p>I am writing a kernel module in which i have 3 source files and one header file. When I compile it, it shows me the following error:</p>
  
  <pre><code>/home/karan/project/proc.o: In function `proc_read':
  /home/karan/project/proc.c:23: multiple definition of `info'
  /home/karan/project/main.o:/home/karan/project/main.c:23: first defined here
  /home/karan/project/tx_pkt.o: In function `tx_packet':
  /home/karan/project/tx_pkt.c:9: multiple definition of `info'
  /home/karan/project/main.o:/home/karan/project/main.c:23: first defined here
  </code></pre>
  
  <p>I think the problem is the compiler is taking definition <code>struct info</code> more then once. But what is the solution? The <code>struct info</code> is declared in the header file . The header file is as follow:</p>
  
  <pre><code>int proc_write(struct file *filp,const char *buffer,unsigned long count,void *data);
  int proc_read(char *buffer,char **buffer_location,off_t offset,int buffer_length,int *eof,void *data);
  void tx_packet(void);
  
  #ifndef MYDEFS_H
  #define MYDEFS_H
  
  
  struct inform
  {
  char tx_buffer[100];
  struct iphdr *ip1;
  };
  
  
  extern struct inform info;
  
  
  #endif
  </code></pre>