Go to Post I dunno, with those Chucks, I'd be inclined to say he out-dresses the better part of DC... - Nuttyman54 [more]
Home
Go Back   Chief Delphi > Technical > Programming
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
VEXpro
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
Team 221 LLC
ADVERTISEMENT

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-13-2006, 04:37 PM
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,422
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 : 02-13-2006 at 04:39 PM.
  #2   Spotlight this post!  
Unread 02-13-2006, 04:47 PM
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: Schaumburg, IL
Posts: 1,344
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 02-13-2006, 04:53 PM
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,422
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 03-06-2005 01:03 AM
Linker Error Max Lobovsky Programming 4 05-27-2004 07:16 PM
Linker Error help Dinush Programming 3 02-11-2004 08:44 PM


All times are GMT -5. The time now is 05:58 AM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School