|
t0xic_kitt3n
|
 |
« on: 07 December, 2010, 23:40:38 » |
0
|
What is going on here? 1 2 3 4 5 6 7 8
| $ make nspire-gcc -Os -Wall -W -c sprites.c nspire-ld main.o utils.o game.o graphics.o sprites.o -o particles.elf sprites.o:(.bss+0x0): multiple definition of `tank' game.o:(.bss+0x0): first defined here collect2: ld returned 1 exit status make: *** [particles.tns] Error 1
|
|
|
|
|
|
Logged
|
██████ ██ ██ ███████ ████ ██ ██ ██ ███████ █ ██ █ ██ ██ ██ █ ██ ██ ████ ███ ███ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ █ ██ ██ ██ ███████ ██ █ ██ ██████ █████ ██ ██ ██ ██ █ ██ █████ ██ ██ ██ ██ █ ██ ███ ██████ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ █ ████ ██ ██ ███████ █████ ██ ██ ██ ██ ███████
|
|
|
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
Offline
Gender: 
Last Login: Today at 06:30:47
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2738
Total Post Ratings: +376
|
 |
« Reply #1 on: 07 December, 2010, 23:44:03 » |
+1
|
It looks like you declared a global variable called tanks in sprites.c when there was already a global variable called tanks in game.c
|
|
|
|
|
Logged
|
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
|
|
|
|
t0xic_kitt3n
|
 |
« Reply #2 on: 07 December, 2010, 23:53:43 » |
0
|
Odd ... I never declared anything called tank in game.c. Changing the name in sprites.c worked, though. Thanks for the help! Also, I noticed your respect was at +84 
|
|
|
|
« Last Edit: 08 December, 2010, 00:55:19 by fb39ca4 »
|
Logged
|
██████ ██ ██ ███████ ████ ██ ██ ██ ███████ █ ██ █ ██ ██ ██ █ ██ ██ ████ ███ ███ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ █ ██ ██ ██ ███████ ██ █ ██ ██████ █████ ██ ██ ██ ██ █ ██ █████ ██ ██ ██ ██ █ ██ ███ ██████ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ █ ████ ██ ██ ███████ █████ ██ ██ ██ ██ ███████
|
|
|
|
t0xic_kitt3n
|
 |
« Reply #3 on: 08 December, 2010, 00:56:04 » |
0
|
Sorry for the double post, but the problem is back again. Now, after I changed tank to tanksprite in sprites.c and game.c, I get the same error. I am not using a header file for sprites.c, just putting #include "sprites.c" at the top of game.c. Could this be why?
|
|
|
|
|
Logged
|
██████ ██ ██ ███████ ████ ██ ██ ██ ███████ █ ██ █ ██ ██ ██ █ ██ ██ ████ ███ ███ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ █ ██ ██ ██ ███████ ██ █ ██ ██████ █████ ██ ██ ██ ██ █ ██ █████ ██ ██ ██ ██ █ ██ ███ ██████ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ ██ ██ ██ █ ████ ██ ██ ███████ █████ ██ ██ ██ ██ ███████
|
|
|
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
Offline
Gender: 
Last Login: Today at 06:30:47
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2738
Total Post Ratings: +376
|
 |
« Reply #4 on: 08 December, 2010, 01:00:08 » |
0
|
Ah yeah, you probably shouldn't be including a .c file. The makefile compiles sprites.c separately, so essentially you are including the sprites.c code twice in the whole project. If you really want to include code, make it a .h file or something.
Edit: After taking a closer look at the Makefile, I suppose it'll only compile sprite.c separately if you have sprite.o after OBJS in the Makefile. I might be wrong, though.
|
|
|
|
« Last Edit: 08 December, 2010, 01:03:30 by calc84maniac »
|
Logged
|
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
|
|
|
|
willrandship
|
 |
« Reply #5 on: 08 December, 2010, 01:08:32 » |
0
|
why not change sprites.c to sprites.h? It shouldn't matter (I think), but no program is perfect 
|
|
|
|
|
Logged
|
|
|
|
|