title: Makefile for pthreads
body: <p>I am trying to compile a pthread example, but am getting the following error:</p>
  
  <pre><code>make: *** No rule to make target `example.cpp', needed by `example.o'.  Stop.
  </code></pre>
  
  <p>This is my makefile:</p>
  
  <pre><code>CC = g++
  CCFLAGS = -Wall
  
  example: example.o
          $(CC) $(CCFLAGS) -o example example.o -pthread
  
  example.o: example.cpp
          $(CC) $(CCFLAGS) -c example.cpp -pthread
  
  clean:
          - rm *.o
          - rm example
  </code></pre>
  
  <p>I included the -pthread flag, I am not sure what else it wants in order to compile.  Anyone have any ideas?  Thank you very much.</p>