title: undefined reference.. linker command failed with exit code 1
body: <p>I want to create a shell file using the c language programming. I have this scheleton given already by the professor, but wen I try to executed I have this error<img src="https://i.stack.imgur.com/Hrr35.png" alt="enter image description here"> and I have this problem</p>
  
  <p>the myshell.c file (and this file is the one that I have to modify and execute)</p>
  
  <pre><code>/* RCS information: $Id: myshell.c,v 1.2 2006/04/05 22:46:33 elm Exp $ */
  
  #include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;errno.h&gt;
  
  extern char **getcmdstring(char *cmd);
  
  int main(void) {
    int i;
    char **args; 
    char cmd[4096];
  
    while(1) {
      printf("$ ");
      fgets(cmd,4096,stdin);
      args = getcmdstring(cmd);
      for(i = 0; args[i] != NULL; i++) {
        printf("Argument %d: %s\n", i, args[i]);
      }
    }
  }
  </code></pre>
  
  <p>and the shell.l file</p>
  
  <pre><code>/* RCS information: $Id: shell.l,v 1.1 2006/04/05 22:46:33 elm Exp $ */
  
  #include &lt;stdio.h&gt;
  #include &lt;strings.h&gt;
  #include &lt;string.h&gt;
  
  int _numargs = 200;
  char *_args[200];
  int _argcount = 0;
  char *strdup(const char *);
  %}
  
  WORD [a-zA-Z0-9\/\.-]+
  SPECIAL [()&gt;&lt;|&amp;;]
  
  %%
    _argcount = 0; _args[0] = NULL;
  
  {WORD}|{SPECIAL} {
    if(_argcount &lt; _numargs-1) {
      _args[_argcount++] = (char *)strdup(yytext);
      _args[_argcount] = NULL;
    }
  }
  
  \n return (int)_args;
  
  [ \t]+
  
  .
  
  %%
  
  char **getcmdstring(char *cmd) {
      char **ret;
      yy_scan_string(cmd);
      ret = (char **)yylex();
      yy_delete_buffer(YY_CURRENT_BUFFER);
      return ret;
  }
  </code></pre>