title: Error Message Undefined reference:
body: <p>I have the following error messages, please help me why they are not working:</p>
  
  <p>/tmp/ccKUDnGv.o: In function 'main':</p>
  
  <p>Fork.c:(.text+0x18): undefined reference to 'Open'</p>
  
  <p>Fork.c:(.text+0x25): undefined reference to 'Wait'</p>
  
  <p>Fork.c:.text+0x36): undefined reference to 'Read'</p>
  
  <p>collect2: ld returned 1 exit status</p>
  
  <pre><code>#include "csapp.h"
  
  int main()
  {
    int fd;
    char c;
  
    fd = Open("foobar.txt",O_RDONLY,0);
    if (Fork == 0)
    {
      Read(fd, &amp;c, 1);
      exit(0);
    }
      Wait(NULL);
      Read(fd, &amp;c, 1);
      printf("c = %c\n", c);
      exit(0);
  }//end main()
  </code></pre>
  
  <p>Open, Wait and Read are included in "csapp.h" Here they are(The file is too large to post here so I am only putting what they look like):</p>
  
  <pre><code>  pid_t Wait(int *status);
    int Open(char *pathname, int flags, mode_t mode);
    ssize_t Read(int fd, void *buf, size_t count);
  </code></pre>
  
  <p>Do I also need to include a csapp.c from somewhere?</p>