Hello,

   I have been using the IAR compiler for my work with an msp430F135 mcu.
The client that I am working for was going to purchase a license to IAR, but
thought the price too high. So, a few days ago, I began the task of setting
up a gcc environment (including CodeBlocks), and adjusting my code to work
with the new environment. I had definde all of my strings that I displayed
on an LCD using #defines  like:

#define AverageCurrentDisp   "Bat Avg Current"

I soon discovered that when I used these precompiler directives in gcc, the
string was given an address which began at 0xfc00, and quickly over running
the .text section. So, I looked in the manual, and found out that if I
defined the strings as constants, they would be allocated in the main ROM
space... SO, I created a module 'Constants.h' like 

const char AverageCurrentDisp[]   = "Bat Avg Current";

Now I have a new problem. In spite of the fact that I use a

#ifndef __Constant__h
#define __Constant__h
#endif

around my new .h file, I am getting an error message:

obj\Debug\Display.o:(.text+0x30): multiple definition of
`AverageCurrentDisp'

What am I doing wrong, and why does it seem as though the string is still
being placed in the .text section?

-- 
View this message in context: 
http://www.nabble.com/multiple-definition-of-...-tp22002722p22002722.html
Sent from the MSP430 gcc - Users mailing list archive at Nabble.com.


Reply via email to