AVR Eclipse plug-in problem

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I installed Eclipse and the AVR plugin all works well on Ubuntu 8.04. I updated to 9.04 and now I do have a problem compiling a program under Eclipse.

When I compile a application in Eclipse I got the following problems:

- expected specifier-qualifier-list before "˜uint8_t
- "˜DDRB' undeclared (first use in this function)
- "˜PORTC' undeclared (first use in this function)
- "˜PORTB' undeclared (first use in this function)
etc

I installed all the AVR-GCC packages
But still is there something wrong. Does anybody have a suggestion what the problem is and how do I solve it.

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is not a Eclipse problem it is a avr-gcc problem:

If I compile direct with avr-gcc I got the following error messages:

Interface.c:132: error: ‘PORTD’ undeclared (first use in this function)
Interface.c:132: error: ‘PD4’ undeclared (first use in this function)
Interface.c:133: error: ‘PD7’ undeclared (first use in this function)
Interface.c:134: error: ‘PORTB’ undeclared (first use in this function)
Interface.c:134: error: ‘PB1’ undeclared (first use in this function)
Interface.c:135: error: ‘PB2’ undeclared (first use in this function)
Interface.c:136: error: ‘PB0’ undeclared (first use in this function)
Interface.c:137: error: ‘PB6’ undeclared (first use in this function)
Interface.c:138: error: ‘PD2’ undeclared (first use in this function)

Can you please tell me what I'm doeing wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

including the files:

#include
#include
#include

Fixed the problem. Thanks for you're help!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I included the but i still get the same error..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

If I compile direct with avr-gcc

Tell us exactly how that command line looked.

I suspect you missed to specify the -mmcu switch, and without that there is no way for avr/io.h to get to the correct part-specific header file. Thu syou wil not get any defines for the SFRs for ports etc..

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
Quote:

If I compile direct with avr-gcc

Tell us exactly how that command line looked.

I suspect you missed to specify the -mmcu switch, and without that there is no way for avr/io.h to get to the correct part-specific header file. Thu syou wil not get any defines for the SFRs for ports etc..

exactly! I tried the command line -mmcu=atmega32 input and the compilation is successful.
Even adding the "may" solve the issue.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Even adding the "may" solve the issue.

Don't do this. The avr/io.h file in concert with the -mmcu compiler switch is specifically designed to do this for you. avr/io.h might also do other useful stuff that your app eventually might need. And then you will want to port your code to another AVR model. You will end up reinventing what avr/io.h already does.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]