title: unresolved external errors
body: <p>I have the following .h and .cpp files</p>
  
  <p>If i have to I will include the full codes of the function definitions</p>
  
  <p>When i compile my program i get the errors shown at the end</p>
  
  <p>hash.h</p>
  
  <pre><code>    #define BUCKETS 64
         #define B_ENTRIES 50000
         int curr_tanker;
         typedef unsigned long int ulong;
  typedef struct bucket
  {
      int bucket_id;
      ulong bucket_entries;
  }bucket;
  
  typedef struct tanker_record
  {
      ulong tanker_id;
      ulong tanker_size;
      ulong num_of_entries;
      ulong bucket_entry_count;
     }tanker_record;
  typedef struct fpinfo
  { 
      unsigned long chunk_offset;
      unsigned long chunk_length;
      unsigned char fing_print[33];
  
  }fpinfo;
  
  struct fpinfo* InitHTable(fpinfo *);
  int CreateTanker(tanker_record tr[]);
  int Hash_CreateEntry(struct fpinfo *,struct fpinfo he,tanker_record tr);
  </code></pre>
  
  <p>ht.cpp</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include&lt;stdio.h&gt;
  #include &lt;iostream&gt;
  
  #include "ht.h"
  
  struct fpinfo* InitHTable(struct fpinfo ht[][B_ENTRIES])
  {
  }
  int CreateTanker(tanker_record tr[])
  {
  }
  int
  Hash_CreateEntry(struct fpinfo *t[][B_ENTRIES],struct fpinfo he,tanker_record tr[])
  {
  }
  static void
  WriteHTtoFile(struct fpinfo *t[][B_ENTRIES],int this_tanker)
  {
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include"ht.cpp"
  #include&lt;conio.h&gt;
  #include&lt;stdlib.h&gt;
  
  void main(int argc, char **argv)
  {
  static fpinfo hash_table[BUCKETS][B_ENTRIES];
  static tanker_record tr[100];
  InitHTable(&amp;hash_table[0][0]);
  CreateTanker(tr);
  struct fpinfo fp;
  ... 
  ar = Hash_CreateEntry(&amp;hash_table[0][0], fp,tr[0]);
  </code></pre>
  
  <p>i get the following errors when i try to compile it using vc2010</p>
  
  <blockquote>
    <p>1>main.obj : error LNK2005: "struct fpinfo * __cdecl InitHTable(struct  fpinfo (* const)[50000])" (?InitHTable@@YAPAUfpinfo@@QAY0MDFA@U1@@Z) already defined in ht.obj</p>
    
    <p>1>main.obj : error LNK2005: "int __cdecl CreateTanker(struct tanker_record * const)"
    (?CreateTanker@@YAHQAUtanker_record@@@Z) already defined in ht.obj</p>
    
    <p>1>main.obj : error LNK2005: "int __cdecl Hash_CreateEntry(struct fpinfo * (* const)[50000],struct fpinfo,struct tanker_record * const)" (?Hash_CreateEntry@@YAHQAY0MDFA@PAUfpinfo@@U1@QAUtanker_record@@@Z) already defined in ht.obj
    1>main.obj : error LNK2005: "int curr_tanker" (?curr_tanker@@3HA) already defined in ht.obj
    1>main.obj  : error LNK2019: unresolved external symbol "int __cdecl Hash_CreateEntry(struct fpinfo *,struct fpinfo,struct tanker_record)"
    (?Hash_CreateEntry@@YAHPAUfpinfo@@U1@Utanker_record@@@Z) referenced in function _main 
    1>main.obj : error LNK2019: unresolved external symbol "struct fpinfo * __cdecl InitHTable(struct fpinfo *)" (?InitHTable@@YAPAUfpinfo@@PAU1@@Z) referenced in function _main</p>
  </blockquote>
  
  <p>THANKS FOR YOUR HELP!!</p>