Undefined reference to 'readline' - C
<p>The error I'm getting:</p>

<pre class="lang-none prettyprint-override"><code>undefined reference to `readline'
</code></pre>

<p>Here is my makefile:</p>

<pre class="lang-none prettyprint-override"><code>all: stest stestdebug

stest: stest.o struct.o
    gcc -g stest.o struct.o -lreadline -lncurses -o stest

stest.o: stest.c struct.h
    gcc -g -c stest.c 

stestdebug: stestdebug.o struct.o
    gcc -g stestdebug.o struct.o -o stestdebug

stestdebug.o: stest.c struct.h
    gcc -g -c stest.c -o stestdebug.o 

struct.o: struct.c struct.h
    gcc -g -c -DDEBUG struct.c 

clean:
    rm -f *.o stest stestdebug

docs:
    doxygen
    chmod a+r html/*
    cp -p html/* ~/public_html/cs2303assig4
</code></pre>

<p>I've already imported all the necessary libraries for readline but am still getting this error.</p>

<p>Here is the code where I call it:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
#include &lt;readline/readline.h&gt;
#include &lt;readline/history.h&gt;
#include "struct.h"

void requestInput() {
  printf("Please fill out all prompts to create a new emplyoee.\n");
  char *name = readline("Name:");
}
</code></pre>