Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jezhoyland
PostPosted: Mar 26, 2011 - 03:56 PM
Rookie


Joined: Sep 18, 2010
Posts: 37


Not sure if I'm on the right forum [moderator: ASF isn't the right forum so moving this], but I'm having a problem with these 2 "linker"...? errors coming up when I try to compile a short program with ICCAVR, can anyone tell me what the problem might be and how to solve it?

Thanks in advance.

-------------- Build: default in Video ---------------

iccavr.exe -c -IC:\iccv8avr\include C:\DOCUME~1\Owner\MYDOCU~1\Video\main.c -o .objs\main.o
iccavr.exe -LC:\iccv8avr\lib -o bin\Release\Video .objs\main.o
!ERROR {linker} file 'crtavr.o': undefined symbol 'hwstk_size'
!ERROR {linker} file 'crtavr.o': undefined symbol 'ram_end'
Process terminated with status 1 (0 minutes, 3 seconds)
2 errors, 0 warnings
 
 View user's profile Send private message  
Reply with quote Back to top
tubecut
PostPosted: Mar 26, 2011 - 04:40 PM
Resident


Joined: May 27, 2002
Posts: 737
Location: Alabama USA

Can you list your code? What version of ICCAVR are you using?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
bobgardner
PostPosted: Mar 26, 2011 - 04:52 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21262
Location: Orlando Florida

I can see those parameters in the LFLAGS line in the project makefile. Can you compile other simple programs ok?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jezhoyland
PostPosted: Mar 26, 2011 - 05:30 PM
Rookie


Joined: Sep 18, 2010
Posts: 37


Here is a sample bit of code: -

Code:
//ICC-AVR application builder : 11/26/2010 3:33:54 PM
// Target : M328p
// Crystal: 16.000Mhz

#include <iom328pv.h>
#include <macros.h>

void port_init(void)
{
 PORTB = 0x00;
 DDRB  = 0xFF;
 PORTC = 0x00;
 DDRC  = 0x00;
 PORTD = 0x00;
 DDRD  = 0x00;
}

//call this routine to initialize all peripherals
void init_devices(void)
{
 //stop errant interrupts until set up
 CLI(); //disable all interrupts
 port_init();

 MCUCR  = 0x00;
 TIMSK0 = 0x00; //timer interrupt sources
 TIMSK1 = 0x00; //timer interrupt sources
 TIMSK2 = 0x00; //timer interrupt sources
 PCMSK0 = 0x00;
 PCMSK1 = 0x00;
 PCMSK2 = 0x00;
 EIMSK  = 0x00;
 EICRA  = 0x00; //extended ext ints
 PCICR  = 0x00;
// PRR0   = 0x00
 SEI(); //re-enable interrupts
 //all peripherals are now initialized
}
//============= start of main ================
unsigned int count1;
unsigned char count;
void main (void)

{
    init_devices();
while(1)
{
 count1++;
 if(count1 == 3)
 {

count ++;
 }
PORTB = 0xff;
}//--end of while-----------------------------------------------------------
}//---end of main ----------------------------------------------------------


And these are the build reports: -

Code:
iccavr.exe -c -IC:\iccv8avr\include  C:\DOCUME~1\Owner\MYDOCU~1\Martin\Martin.c -o C:\DOCUME~1\Owner\MYDOCU~1\Martin\Martin.o
iccavr.exe -LC:\iccv8avr\lib -o "C:\Documents and Settings\Owner\My Documents\Martin\Martin.exe" C:\DOCUME~1\Owner\MYDOCU~1\Martin\Martin.o   
!E {linker} unknown file type 'and'
iccavr.exe: 'C:\iccv8avr\bin\ilinkavr.exe' returns error code -1
Process terminated with status -1 (0 minutes, 1 seconds)
1 errors, 0 warnings


I'm using version 8.01, it's past the demo period but still supposed to allow me a code limited functionality.

Thanks in advance.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2011 - 05:34 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62314
Location: (using avr-gcc in) Finchingfield, Essex, England

It's because of the space in "Documents and Settings". Put your files in "C:\iccfiles" and try again.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
jezhoyland
PostPosted: Mar 26, 2011 - 05:55 PM
Rookie


Joined: Sep 18, 2010
Posts: 37


Tried that, now I'm getting this: -

iccavr.exe -c -IC:\iccv8avr\include C:\iccfiles\Martin.c -o C:\iccfiles\Martin.o
iccavr.exe -LC:\iccv8avr\lib -o C:\iccfiles\Martin.exe C:\iccfiles\Martin.o
!ERROR {linker} file 'crtavr.o': undefined symbol 'hwstk_size'
!ERROR {linker} file 'crtavr.o': undefined symbol 'ram_end'
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings

Did I miss something out?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 26, 2011 - 07:55 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62314
Location: (using avr-gcc in) Finchingfield, Essex, England

Well undefined" means this object file (crtavr.o) is using a symbol ('hwstk_size') that is not being produced by any of the linked components. As this is an internal, "hidden" thing I don't know what would usually be satisfying it (I don't use ICC) so you need to wait for an ICC using expert to come along or email to Richard at Imagecraft to ask him about this.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Mar 26, 2011 - 08:58 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21262
Location: Orlando Florida

So I assume you hit project->new and picked a directory and a name for the project like jhavr. Then you ran the appbuilder, which originally generated the file 'untitled.c', so maybe you saved it with a name like jhtest.c. Then you hit project->build, and it will cook up a makefile with the files you have added to the project, and compile it and link it according to the project->options you have ticked. You should see all the created files in the project dir jhavr. The hwstk is set in the project->options dialog. What number is in that box?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jezhoyland
PostPosted: Mar 28, 2011 - 10:10 PM
Rookie


Joined: Sep 18, 2010
Posts: 37


Assume hwstk means something like Hardware stack, right?
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Mar 28, 2011 - 10:20 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21262
Location: Orlando Florida

Wait a minute! I'M askin' the questions around here! Don't you answer my question with another question!! What number is in the project->options->target-> stack size box?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
jezhoyland
PostPosted: Mar 29, 2011 - 09:14 PM
Rookie


Joined: Sep 18, 2010
Posts: 37


That's part of the problem, it wont let me find out. When I press the Project>Build options menu button, nothing happens. It's not greyed out, it just doesn't do anything. Do you suppose this could be to do with the Demo license having expired? It's still supposed to be usable but with limited code size.
I think I'm going to cry.
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Mar 30, 2011 - 12:22 AM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21262
Location: Orlando Florida

It should compile 4k no prob. Did you create a project? If so, what dir did you create it in? What is the name of the project? What is the name of the c file? Did you add the c file to the project? Did you set the Device Configuration to the correct avr type in the target tab of the Build Options?

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
sxmilovebb
PostPosted: Apr 14, 2011 - 09:59 AM
Newbie


Joined: Apr 14, 2011
Posts: 2


Project -> Build options -> compile,and then enable "Treat "const"....."

look my photo


Last edited by sxmilovebb on Apr 22, 2011 - 06:56 AM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
sxmilovebb
PostPosted: Apr 14, 2011 - 10:00 AM
Newbie


Joined: Apr 14, 2011
Posts: 2


No problem...just try again
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits