I used getdelim in Codeblocks and successfully included but the warning says: undefinded reference to getdelim. Can someone help?
Asked
Active
Viewed 108 times
0
-
Did you include `stdio.h`? If yes and it still gives a warning, try adding `#define _GNU_SOURCE` before the include. – isrnick Jun 04 '20 at 19:00
-
I have already had stdio.h included. It does not work with #define _GNU_SOURCE either – prog1 Jun 04 '20 at 19:12
-
2Looking it up apparently MinGW (codeblock's compiler) doesn't implement POSIX `getdelim` or `getline`: https://stackoverflow.com/questions/60822389/undefined-reference-to-getdelim-error-windows-c-language – isrnick Jun 04 '20 at 20:23
-
You could implement your own function, there is an implementation of `getline` here that you could adapt to make a `getdelim`: https://stackoverflow.com/questions/735126/are-there-alternate-implementations-of-gnu-getline-interface/735472#735472 – isrnick Jun 04 '20 at 20:25