This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

definition in header file

i have defined an array in header file "Variables.h" and include it to source files.
extern char LCD[11] = {0xF6, 0xC0, 0x6E, 0xEA, 0xD8, 0xBA, 0xBE, 0xE0, 0xFE, 0xFA, 0x00};

when am trying to compile i get the next message:

Build target 'Target 1'
assembling LPC2300.s...
compiling Main.c...
compiling Interrupts.c...
compiling Init.c...
compiling LCD_ML1001.c...
linking...
Second Counter + TI8148.axf: Error: L6200E: Symbol LCD multiply defined (by interrupts.o and main.o).
Second Counter + TI8148.axf: Error: L6200E: Symbol LCD multiply defined (by init.o and main.o).
Second Counter + TI8148.axf: Error: L6200E: Symbol LCD multiply defined (by lcd_ml1001.o and main.o).
Second Counter + TI8148.axf: Not enough information to list image symbols.
Second Counter + TI8148.axf: Not enough information to list the image map.
Second Counter + TI8148.axf: Finished: 2 information, 0 warning and 3 error messages.
Target not created

Parents

  • "multiply defined"
    is an extremely ugly piece of English, and whoever wrote it should be shot.

    It's bad enough for native English speakers, and I have every sympathy with non-native speakers who find it confusing.

    See: www.keil.com/.../search.asp

    A far better phrasing would be something like:

    Error: L6200E: Multiple definitions of symbol 'LCD' (by interrupts.o and main.o).
    Error: L6200E: Multiple definitions of symbol 'LCD' (by init.o and main.o).
    Error: L6200E: Multiple definitions of symbol 'LCD' (by lcd_ml1001.o and main.o).
    

    Now, think about it: If you put a definition in a header file, and then #include that header file in multiple source files, you are obviously going to get multiple definitions - aren't you?!

    This is basic 'C' stuff - nothing specifically to do with Keil or ARM.

    See: c-faq.com/.../decldef.html

Reply

  • "multiply defined"
    is an extremely ugly piece of English, and whoever wrote it should be shot.

    It's bad enough for native English speakers, and I have every sympathy with non-native speakers who find it confusing.

    See: www.keil.com/.../search.asp

    A far better phrasing would be something like:

    Error: L6200E: Multiple definitions of symbol 'LCD' (by interrupts.o and main.o).
    Error: L6200E: Multiple definitions of symbol 'LCD' (by init.o and main.o).
    Error: L6200E: Multiple definitions of symbol 'LCD' (by lcd_ml1001.o and main.o).
    

    Now, think about it: If you put a definition in a header file, and then #include that header file in multiple source files, you are obviously going to get multiple definitions - aren't you?!

    This is basic 'C' stuff - nothing specifically to do with Keil or ARM.

    See: c-faq.com/.../decldef.html

Children