[Icc-avr] Error message
John Baraclough
j_baraclough at zetnet.co.uk
Mon Sep 3 09:31:53 PDT 2007
Hi Bengt,
You got that message because that is exactly what
you have done. Global variables can only be
defined in one place in the whole project.
Everywhere else you must use the 'extern' keyword.
John
P.S. Last week Richard said he was going away for
a "couple of years". I hope he only meant a
"couple of weeks", but he has been very quiet.
At 07:50 03/09/2007, you wrote:
>I got this error:
>
>!E filename.o(294): multiple define: myVar
>
>I did have some problems with multiple defined
>variables because of a bad #define in a header.
>But it was not with this variable so I just
>didnt understand a thing until I found out that
>I had assigned a value to this global variable
>and also by mistake assigned it in the place
>there it was defined as extern. Like this:
>
>In main file:
>static unsigned char myVar=0;
>
>In other files:
>unsigned char myCar=0;
>
>Richard: Is it possible that this could result
>in some other error message than multiple
>define? Something like multiple assigning of predefined value
>
>/Bengt
>________________________________________________________________
>
>Bengt Ragnemalm Tel +46 13 22 24 97
>
>Research engineer FAX: +46 13 10 19 02
>
>Linköpings
>Universitet
><mailto:bengt.ragnemalm at imt.liu.se>mailto:bengt.ragnemalm at imt.liu.se
>
>Inst. för Medicinsk Teknik
>Internet: <http://www.imt.liu.se/>http://www.imt.liu.se
>
>S-581 85 Linköping SWEDEN
>
>
>
>_______________________________________________
>Icc-avr mailing list
>Icc-avr at imagecraft.com
>http://dragonsgate.net/mailman/listinfo/icc-avr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070903/3eea0219/attachment.html
More information about the Icc-avr
mailing list