Code::Blocks Forums

User forums => Embedded development => Topic started by: markp on April 13, 2017, 11:45:07 pm

Title: avr-gcc: error: specified option ‘-mmcu’ more than once
Post by: markp on April 13, 2017, 11:45:07 pm
 The first AVR project I tried gave the following error -

Code
-------------- Build: Release in avrblink03 (compiler: GNU GCC Compiler for AVR)---------------

avr-gcc -Wall -mmcu=atmega328p -DF_CPU=8000000UL -mmcu=atmega329p -I/usr/lib/avr/include -c fuse.c -o obj/Release/fuse.o
avr-gcc: error: specified option ‘-mmcu’ more than once

 I looked around the CB files and found that mmcu is specified in the  .cbp file - in xml format - and also in Project->Build Options Compiler Settings->Other compiler Options.

Deleting the line from Other Compiler Options fixes the the problem but has to be done each project. Is there a global way to stop mmcu being specified twice ?
Title: Re: avr-gcc: error: specified option ‘-mmcu’ more than once
Post by: oBFusCATed on April 14, 2017, 02:11:33 am
Yes, remove it from the global compiler options or edit the avr project template your using to create your projects...