Build project error in Eclipse

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

Hi all,

I'm getting an error when I build my project in Eclipse. I don't know if it's caused by the AVR plugin or my gcc version.

Here's what is returned in the console:


**** Clean-only build of configuration Debug for project SharpIR ****

make clean 
rm -rf  ./SharpIR.o ./a2d.o  ./SharpIR.d ./a2d.d  SharpIR.hex  SharpIR.lss  sizedummy  SharpIR.elf
 

**** Build of configuration Debug for project SharpIR ****

make all 
Building file: ../SharpIR.c
Invoking: AVR Compiler
avr-gcc -Wall -g2 -gstabs -O0 -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -mmcu=atmega168 -DF_CPU=1000000UL -MMD -MP -MF"SharpIR.d" -MT"SharpIR.d" -c -o"SharpIR.o" "../SharpIR.c"
as: unrecognized option '-mmcu=atmega168'
make: *** [SharpIR.o] Error 1

Environment:
OS - Ubuntu Linux 8.10
AVR gcc version - 4.3.0
Eclipse version - 3.4.0
AVR Eclipse plugin version - 2.3.1

Any help is appreciated.

Thanks!

Kevin

Edit::
I found a reference in my project to avr-gcc-4.2.2.

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

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

I was re-reading the sticky on building the AVR GCC, paying particular attention to this:

Quote:

18-Nov-2008
Updated the scriptfiles to build binutils and insight without the -Werror flag. This was caused by GCC 4.3.x (on Ubuntu 8.10) being unable to build the targets. And was due to a lot of new warnings being enabled by default. Use unzip to extract the files.

Is this saying there is a bug in the 4.3.x versions and could this be what is causing my problem?

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

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

Eclipse is calling 'as', which is the native assembler. It needs to call 'avr-as' which is the GNU assembler for the AVR port.

This is an issue with your installation of the AVR toolchain. Did you build binutils for the AVR target? Did you build it before building gcc? Did you have your installation directory in the PATH environment variable when you built gcc? It's probably one of those issues.

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

I can't quite remember, but I think my AVR GCC was upgraded by the update manager. What it sounds like is I need to remove my current AVR toolchain and reinstall. Is 4.2.2 the version I should use?

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

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

Use whatever version you are comfortable with.