Hey Salem,
Thanks for replying. I had a tough time with the chapter that covered header files. I should have figured out my issue back then rather than simply plowing forward. I went back and reviewed the chapter but, still stumped.
All 3 files (inventory.c, readline.h, readline.c) are in the same directory. Here is the readline.c file:
Code:
#include <ctype.h>
#include <stdio.h>
#include "readline.h"
int read_line(char str[], int n)
{
int ch, i=0;
while (isspace(ch= getchar()))
;
while (ch != '\n' && ch != EOF) {
if (i < n)
str[i++] = ch;
ch = getchar();
}
str[i] = '\0';
return i;
}
When I try to compile inventory.c, the error is:
C:\work\.....\inventory.o:inventory.c|| undefined reference to `read_line'
Not sure if it matters but, notice the different single quotes around `read_line'. I can't find any place in my code where I used different single quotes ` vs '.
When I try to compile readline.c, the error is:
~ undefined reference to `WinMain'
Thank you.