title: undefined reference to regcomp
body: <p>I'm developing stm32 with SW4STM32.
  When I tried to use arm-none-eabi\include\regex.h, I included  and compiled.
  And then I got a strange things.
  regex.h defined various canstant, for example</p>
  
  <pre><code>#define REG_NOMATCH  1
  #define REG_BADPAT   2
  #define REG_ECOLLATE 3
  #define REG_ECTYPE   4
  </code></pre>
  
  <p>and voarious struct,</p>
  
  <pre><code>typedef struct {
      int re_magic;
      size_t re_nsub;     /* number of parenthesized subexpressions */
      __const char *re_endp;  /* end pointer for REG_PEND */
      struct re_guts *re_g;   /* none of your business :-) */
  } regex_t;
  </code></pre>
  
  <p>and some function, including</p>
  
  <pre><code>int regcomp(regex_t *__restrict, const char *__restrict, int);
  size_t  regerror(int, const regex_t *__restrict, char *__restrict, size_t);
  int regexec(const regex_t *__restrict, const char *__restrict,
              size_t, regmatch_t [__restrict], int);
  void    regfree(regex_t *);
  </code></pre>
  
  <p>The following is my code </p>
  
  <pre><code>u8 Is_REG_Match(char* reg,char* s){
  
  u8 z=0;
  u8 z1=0;
  regex_t reg_temp;
  
  z=regcomp(&amp;reg_temp,reg,0);
  regcomp(&amp;reg_temp, reg , 0);
  if(z==0){
  z1=regexec(&amp;reg_temp,s,0,NULL,0);
  regfree(&amp;reg_temp);
  return z1;
  }
  else
  return 200;
  </code></pre>
  
  <p>}</p>
  
  <p>and when I compiled, reg_temp is good, but function regcomp, regexec and regfree was error--undefined reference to 'regcomp',etc.</p>
  
  <p>The regex.h is definitely compiled, as I try to delete the define of struct regex_t in regex.h and </p>
  
  <pre><code>regex_t reg_temp;
  </code></pre>
  
  <p>become error.</p>
  
  <p>It seems like the regex.h is compiled not completely, just missing the function part.
  How can I fix it?</p>