niezdefiniowane odniesienie do `getline 'w c
Uczę się używać getline w programowaniu C i wypróbowałem kody zhttp://crasseux.com/books/ctutorial/getline.html
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int atgc, char *argv[])
{
int bytes_read = 1;
int nbytes = 10;
char *my_string;
my_string = (char *)malloc(nbytes+1);
puts("Please enter a line of text");
bytes_read = getline(&my_string, &nbytes, stdin);
if (bytes_read == -1)
{
puts ("ERROR!");
}
else
{
puts ("You typed:");
puts (my_string);
}
return 0;
}
Jednak problem polega na tym, że kompilator powraca błędy tego:niezdefiniowane odniesienie do „getline”. Czy możesz mi powiedzieć, na czym polega problem? Dziękuję Ci!
Używam Win7 64bit + Eclipse Indigo + MinGW