Go to Post We owe a lot to Bob (Hammond), he is a true gentleman. - Covey41 [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 17-02-2006, 22:04
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Urgent help needed... Structs and compiling issues

okay so i make a simple structure like this:
Code:
struct constants
{
int KP;
int KI;
int KD;
int div;
};
then reference it here:
struct constants pid[2]={{0,0,0,0},{0,0,0,0}};
this works fine and dandy but when i do this it gives me a linker error:

struct constants pid[4]={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};

What is going on I CANNOT figure it out! the linker says something like this:

idata_pid.o cannot fit the section. Section "idata_pid.o" length = 0x0000010a

please help...! i can't figure it out ... this is so simple yet frustrating
__________________
Team 701
  #2   Spotlight this post!  
Unread 18-02-2006, 11:39
JonathanLKS JonathanLKS is offline
Code::Blocks
FRC #0610 (The Coyotes)
Team Role: Leadership
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Toronto
Posts: 36
JonathanLKS will become famous soon enough
Send a message via MSN to JonathanLKS
Re: Urgent help needed... Structs and compiling issues

It sounds like you are using too much memory.
Try making the variables smaller like a short int or an unsigned char
  #3   Spotlight this post!  
Unread 18-02-2006, 12:07
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Urgent help needed... Structs and compiling issues

thats what i thought of as well... but doesn't a char take just as memory as an int ? i will try it though... i don't see why though... i mean watsons struct has 6-7 ints... maybe i have too many we'll see ... thanks
__________________
Team 701
  #4   Spotlight this post!  
Unread 18-02-2006, 13:18
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: Urgent help needed... Structs and compiling issues

Quote:
Originally Posted by Salik Syed
but doesn't a char take just as memory as an int?
A char is 8 bits and an int is 16 bits when the MCC compiler is used.
  #5   Spotlight this post!  
Unread 18-02-2006, 14:28
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Urgent help needed... Structs and compiling issues

Quote:
Originally Posted by Salik Syed
...this works fine and dandy but when i do this...:

struct constants pid[4]={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};

...the linker says something like this:

idata_pid.o cannot fit the section. Section "idata_pid.o" length = 0x0000010a
Each module is allowed only 256 (0x100) bytes of data. When you added this declaration to pid.c, you pushed it over the limit by 10 (0x0a) bytes. You might be able to get around this limit by putting the declaration in another .c file, and reference it as an extern from pid.c.



[edit]Woah! post #2048! Sweeeet! [/edit]
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 18-02-2006 at 14:31.
  #6   Spotlight this post!  
Unread 18-02-2006, 20:36
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Urgent help needed... Structs and compiling issues

[edit]Woah! post #2048! Sweeeet! [/edit]

anyone that jubilates over having a post count equal to a power of two is a true nerd.

161 posts until i can celebrate !
__________________
Team 701
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


All times are GMT -5. The time now is 00:38.

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