Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 08:16:41 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: nspire-ld question -  (Read 591 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Topic starter
Total Post Ratings: +32

View Profile
« 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 Offline

Gender: Male
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

View Profile
« 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
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Topic starter
Total Post Ratings: +32

View Profile
« 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 Wink
« Last Edit: 08 December, 2010, 00:55:19 by fb39ca4 » Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Topic starter
Total Post Ratings: +32

View Profile
« 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 Offline

Gender: Male
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

View Profile
« 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
Omnimagus of the Multi-Base.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 01:57:19
Date Registered: 11 April, 2010, 03:08:32
Location: Between Venus and Mars
Posts: 2652


Total Post Ratings: +65

View Profile
« 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 Tongue
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.578 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.