check50 fails to compile for tideman.c (full error here)
tideman.c itself compiles fine (both locally with make
and in check50) but tideman_test.c doesn’t:
running clang tideman.c -o tideman -std=c11 -ggdb -lm -lcs50...
running clang tideman_test.c -o tideman_test -std=c11 -ggdb -lm -lcs50...
tideman_test.c:220:16: error: use of undeclared identifier 'main_id'
while (main_id < left_half_size + right_half_size)
^
tideman_test.c:235:27: error: use of undeclared identifier 'main_id'
tmp_pairs[main_id] = left_half[left_id];
^
tideman_test.c:239:21: error: use of undeclared identifier 'main_id'
main_id += 1;
^
tideman_test.c:240:31: error: use of undeclared identifier 'main_id'
tmp_pairs[main_id] = right_half[right_id];
^
tideman_test.c:246:27: error: use of undeclared identifier 'main_id'
tmp_pairs[main_id] = right_half[right_id];
^
tideman_test.c:249:13: error: use of undeclared identifier 'main_id'
main_id += 1;
^
6 errors generated.
I’ve gone through a bunch of similar posts on Reddit and SOF where the usual causes for this are changing the pre-declared prototypes or some code in main but all I can see when comparing the first and latest versions of my tideman.c are:
- code in place of the
//TODO
placeholders - new functions (and associated prototypes)
Full tideman.c here
Any suggestions?