Go to Post Well I guess that's better than some teams idea of team bonding which would be taping a wayward freshman to the wall with duct tape. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2006, 17:37
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
linker error help

I am getting a: symbol 'FIRE_DELAYS' has multiple definitions

Now the problem is, FIRE_DELAYS is only refrenced two places in my code. they are:
Code:
------ fire_control.h -------
#ifndef __fire_control_h_
#define __fire_control_h_
...
const unsigned char FIRE_DELAYS[] =
	{75,	/*FIRING*/
 	 200,	/*RETRACTING*/
 	 500};	/*LOADING*/
...
#endif

------ fire control.c -------
#include "fire_control.h"

void FireControl(void){
	...
	if(i < FIRE_DELAYS[fireState -1]){
 	 	...
 	}
 	...
}
Am i just totally overlooking something really obvious, or is the linker behaving oddly.
__________________
1139 Alumni

Last edited by Rickertsen2 : 13-02-2006 at 17:39.
  #2   Spotlight this post!  
Unread 13-02-2006, 17:47
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: linker error help

Quote:
Originally Posted by Rickertsen2
Am i just totally overlooking something really obvious, or is the linker behaving oddly.
You're creating the variable in the .h file. This causes a variable named FIRE_DELAYS to be created in every file which includes your .h file. Instead you want to just create it in one .c file and then declare it extern in the others.
  #3   Spotlight this post!  
Unread 13-02-2006, 17:53
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: linker error help

Quote:
Originally Posted by Dave Flowerday
You're creating the variable in the .h file. This causes a variable named FIRE_DELAYS to be created in every file which includes your .h file. Instead you want to just create it in one .c file and then declare it extern in the others.
hah. your right. I can't believe i missed that. Its been a while since i have programmed in anything but java. This whole .h thing takes some getting used to again.
__________________
1139 Alumni
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
guidelines for modifying the linker script??? gnormhurst Programming 2 06-03-2005 02:03
Linker Error Max Lobovsky Programming 4 27-05-2004 20:16
Linker Error help Dinush Programming 3 11-02-2004 21:44


All times are GMT -5. The time now is 01:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi