0

ERROR MESSAGE FOR CODE//

URL/// http://cdn.cs50.net/2015/fall/lectures/1/w/src1w/thadgavin.c

clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow coolcode.c -lcs50 -lm -o coolcode /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2 /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference tomain' clang: error: linker command failed with exit code 1 (use -v to see invocation) make: * [coolcode] Error 1 ~/workspace/ $ make coolcode clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow coolcode.c -lcs50 -lm -o coolcode coolcode.c:61:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] main(void) ^ coolcode.c:74:33: error: unsequenced modification and access to 'n' [-Werror,-Wunsequenced] if ((p+=B)>1){p=2-p;RI(l+j)} ^~~~~~~ coolcode.c:22:28: note: expanded from macro 'RI' =0; n1){p=2-p;RI(l+j)} ^~~~~~~ coolcode.c:22:38: note: expanded from macro 'RI' =0; n1){p=2-p;RI(l+j)} ^~~~~~~ coolcode.c:23:25: note: expanded from macro 'RI' (C,g)Rl(C ,b)++n; } ^~~~~~~~~~~ coolcode.c:19:15: note: expanded from macro 'Rl' n++[C] = tn/12; ^ ~ coolcode.c:75:44: error: unsequenced modification and access to 'n' [-Werror,-Wunsequenced] else if (p<0){p=-p;RI(l)} ^~~~~ coolcode.c:22:28: note: expanded from macro 'RI' =0; nn/12; ^ ~ coolcode.c:75:44: error: unsequenced modification and access to 'n' [-Werror,-Wunsequenced] else if (p<0){p=-p;RI(l)} ^~~~~ coolcode.c:22:38: note: expanded from macro 'RI' =0; nn/12; ^ ~ coolcode.c:75:44: error: unsequenced modification and access to 'n' [-Werror,-Wunsequenced] else if (p<0){p=-p;RI(l)} ^~~~~ coolcode.c:23:25: note: expanded from macro 'RI' (C,g)Rl(C ,b)++n; } ^~~~~~~~~~~ coolcode.c:19:15: note: expanded from macro 'Rl' n++[C] = tn/12; ^ ~ coolcode.c:70:27: error: for loop has empty body [-Werror,-Wempty-body] }for (;n [coolcode] Error 1

0
0

Welcome to the forum. First things first, please read this info on how to format your code. Then edit your post so it is formatted properly. Thanks.

Follow the link in the source code to the ioccc page. Follow some of the links to find out what it's all about. It's very cool. Then search the original page for "thad" (it's a winning entry from 2000). There you will find some links. Copy the Makefile to your working directory. Follow the instructions in thadgavin.hint. Make sure your source is named thadgavin.c.

Not the answer you're looking for? Browse other questions tagged .