1
jharvard@appliance (~/Dropbox/pset3): make ./bounce
clang -ggdb3 -O0 -std=c99 -Wall -Werror    bounce.c  -lcs50 -lm -o bounce
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has    invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 21 has invalid symbol index 22
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/bin/../lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/bounce-54eb4c.o: In function `main_':
/home/jharvard/Dropbox/pset3/bounce.c:7: undefined reference to `newGWindow'
/home/jharvard/Dropbox/pset3/bounce.c:9: undefined reference to `newGOval'
/home/jharvard/Dropbox/pset3/bounce.c:10: undefined reference to `setColor'
/home/jharvard/Dropbox/pset3/bounce.c:11: undefined reference to `setFilled'
/home/jharvard/Dropbox/pset3/bounce.c:12: undefined reference to `add'
/home/jharvard/Dropbox/pset3/bounce.c:18: undefined reference to `move'
/home/jharvard/Dropbox/pset3/bounce.c:20: undefined reference to `getXGeneric'
/home/jharvard/Dropbox/pset3/bounce.c:20: undefined reference to `getWidthGeneric'
/home/jharvard/Dropbox/pset3/bounce.c:20: undefined reference to `getWidthGeneric'
/home/jharvard/Dropbox/pset3/bounce.c:24: undefined reference to `getXGeneric'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bounce] Error 1
jharvard@appliance (~/Dropbox/pset3): 

erm?

1
  • you may need to include a -l switch to the clang command.
    – user2477
    Feb 20 '15 at 8:48
1

I took this off the video and it worked for me:

clang -ggdb3 -Ispl/include -O0 -std=c99 -o bounce bounce.c -Lspl/lib -lcs -lm

Note the bits about spl after -ggdb3 and before -lcs.

1
  • That works. Thanks!
    – user7373
    Jun 28 '15 at 7:11
0

This looks like you don't have the SPL package installed. Check if /usr/include/spl exists and if yes, doublecheck that gwindow.h is there.

5
  • thank you for your reply. it's there.
    – daniel
    Feb 19 '15 at 18:32
  • @daniel , did you include it in your .c file?
    – user2477
    Feb 20 '15 at 8:40
  • #include <spl/gevents.h> #include <spl/gobjects.h> #include <spl/gwindow.h>
    – daniel
    Feb 20 '15 at 18:09
  • I have the same problem. Just checked libraries are present at /usr/include/spl and they are linked in the header of the program...
    – Alex Zamai
    Feb 25 '15 at 16:40
  • did you find a solution yet?
    – daniel
    Apr 8 '15 at 21:42
0

I am also facing the same problem.I have checked if my SPL packages are installed by giving in the command "usr/include/spl" but it shows an error that there is no such file or directory.I even updated my appliance.When i try to run my program it gives a fatal error specifying that "spl/gevents.h" file is not found.I also tried to link it using the "-l" command (clang bounce.c -lspl -o bounce)but the problem still persists.how can I fix this problem?

5
  • It is very frustrating to be stuck at this point with no solution in sight.
    – daniel
    Mar 5 '15 at 9:32
  • Not only for this program, but for even other programs like structs i got the same error.I did what all was mentioned above but still didn't work.Can't understand how to fix this problem. Mar 9 '15 at 16:38
  • "spl/gevents.h"? shouldn't it be <spl/gevents.h>?
    – daniel
    Mar 20 '15 at 18:45
  • @daniel I tries both ways but it throws an error.I am even facing the same problem with breakout in pset3.When i try to run "make window" it throws an error saying that "spl/gwindow.h" is not found Mar 27 '15 at 12:54
  • I have also checked inside /usr/include/spl..the spl folder exists but it does not have the "gwidow.h" or "gevents.h" files.how to fix this problem? Mar 27 '15 at 13:03
0

Compile using: clang -ggdb3 -O0 -std=c99 -Wall -Werror bounce.c -lcs -lm -o bounce

4
  • Oh my... thank you so much. I almost gave up on this.
    – daniel
    Mar 16 '15 at 23:31
  • could you briefly explain to me the line?
    – daniel
    Mar 16 '15 at 23:31
  • thank u very much! though i can't figure it out why that worked ><
    – RLBYC
    Mar 30 '15 at 10:18
  • This worked for me. Is there an explanation available as to why?
    – user8001
    Sep 15 '15 at 1:40

You must log in to answer this question.

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