title: Why is using a macro in my code causing an error and how can I fix it?
body: <p>I wrote this code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define fctrl(N) ( (N==1)? (N) : (N*fctrl(N-1)) )
  
  int main()
  {
      int m,n=7;
      m = fctrl(n);
      printf("fctrl is %d\n",m);
      return 0;
  }
  </code></pre>
  
  <p>While compiling, I got the following error:</p>
  
  <pre><code>/tmp/ccRODXnZ.o: In function `main':
  /home//Desktop/fctrl/fctrl.c:8: undefined reference to `fctrl'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Why was this error displayed and how can I fix it?</p>