title: gcc: not linking files
body: <p>I have main.c, snmpy.c, snmpy.o, and a makefile. I running this on a Linux Server through command line. Here is what is all of them...</p>
  
  <p>main.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include "snmpy.h"
  
  int main(void) {
  
     char* message = sayHello();
  
     printf("%s", message);
  
     return 0;
  }
  </code></pre>
  
  <p>snmpy.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include "snmpy.h"
  
  char* sayHello(){
  
     char* hiya = "Hello!!\n";
  
     return hiya;
  
  }
  </code></pre>
  
  <p>snmpy.h:</p>
  
  <pre><code>char* sayHello();
  </code></pre>
  
  <p>makefile:</p>
  
  <pre><code># Compiler
  CC = /usr/bin/gcc
  
  # Name of program
  PROG = snmpy
  
  # The name of the object files
  OBJS = snmpy.o main.o
  
  # All the header and c files
  SRCS = main.c snmpy.c
  HDRS = snmpy.h
  
  # Add -I to the dir the curl include files are in
  CFLAGS = -c -g -std=c99 -Wall
  
  # Build the executable file
  $(PROG): $(OBJS)
          $(CC) $(CFLAGS) $(OBJS) -o $(PROG)
  
  # Seperately compile each .c file
  main.o: main.c snmpy.h
          $(CC) $(CFLAGS) -c main.c
  
  snmpy.o: snmpy.c snmpy.h
          $(CC) $(CFLAGS) -c snmpy.c
  
  # Clean up crew
  clean:
          rm -fv core* $(PROG) $(OBJS)
  
  cleaner: clean
          rm -fv #* *~
  </code></pre>
  
  <p>When I compile it it gives me this error:</p>
  
  <pre><code>/usr/bin/gcc -c -g -std=c99 -Wall snmpy.o main.o -o snmpy
  gcc: snmpy.o: linker input file unused because linking not done
  gcc: main.o: linker input file unused because linking not done
  </code></pre>
  
  <p>Not sure what's going on whether there is something I'm not doing right, or if I didn't install something. I'm a noob at making make files. I haven't done them in a while.</p>
  
  <p>Thanks in advance!!</p>