Hello, I am trying to run a C program using getline() and am receiving the following error message:
The program is as simple as possible:
I used the definition from getline() on this site: https://wiki.cs.columbia.edu:8443/display/res/getline()+missing
placed this in a getline.c file and included the getline.c file in my program and this resulted in a segmentation fault upon execution.
Thanks to anyone who can point me in the right direction.
Code:
14:42@***:~/Documents/c$ gcc -o 3n1 3n1.c
Undefined symbols:
"_getline", referenced from:
_main in ccMhB6EQ.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Code:
#include <stdio.h>
main()
{
int x;
char *line;
x = getline(line,100,stdin);
}
I used the definition from getline() on this site: https://wiki.cs.columbia.edu:8443/display/res/getline()+missing
placed this in a getline.c file and included the getline.c file in my program and this resulted in a segmentation fault upon execution.
Thanks to anyone who can point me in the right direction.