Under Debian 9.11 I get this error
gcc -o nmonmerge -O3 nmonmerge2.c
nmonmerge2.c: In function ‘main’:
nmonmerge2.c:60:21: warning: implicit declaration of function ‘getopt’ [-Wimplicit-function-declaration]
while ( -1 != (i = getopt(argc, argv, "?hva" ))) {
^~~~~~
nmonmerge2.c:73:5: error: ‘optind’ undeclared (first use in this function)
if(optind +2 != argc) {
^~~~~~
nmonmerge2.c:73:5: note: each undeclared identifier is reported only once for each function it appears in
nmonmerge2.c:90:7: warning: implicit declaration of function ‘strncmp’ [-Wimplicit-function-declaration]
if(!strncmp(string, "ZZZZ,T",6)) {
^~~~~~~
nmonmerge2.c:127:7: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
isdigit(string[j+2]) ) {
^~~~~~~
nmonmerge2.c:166:2: warning: implicit declaration of function ‘unlink’ [-Wimplicit-function-declaration]
unlink(TEMPFILE);
^~~~~~
I added #include <unistd.h> to the file to resolve the error.
Patch in attachment. </unistd.h>
This is just a hack. Dont know the correct way.
Thx for the fish ;)
Joerg
Also added
Released as nmonmerge3.c