title: error - "(.text+0x0): multiple definition of 'method' " (C program)
body: <p>I currently have 2 C-programs and 1 header file that I have to make into a Makefile. I am new to compiling programs into Makefiles but I know the basics. I type in:</p>
  
  <pre><code>cc -c file1.c
  
  cc -c file2.c
  
  cc file1.o file2.o
  </code></pre>
  
  <p>----- I get the following error -----</p>
  
  <pre><code>file2.o: In function 'method':
  
  file2.c:(.text+0x0): multiple definition of 'method'
  
  file1.o:file1.c:(.text+0x0): first defined here
  
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>What is the problem? I heard various things like because they share the same header ('method' is defined in the header file) that the compiler thinks there is two of them. I don't know. What do you guys think?</p>
  
  <p>Thank you,</p>
  
  <p>EDIT:
  Thank you for the responses. What if 'method' is a "struct" function? Would it still be a good idea to just move it to somewhere else? I just tried it and now I'm getting a "dereferencing pointer to incomplete type".</p>