This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Symbol multiply defined

Hey all,

I tried to build my project in the Keil µVision IDE. But everytime I get the same error and I can't figure out where the problem should be. I searched for the multiply defined symbols but I can't find them...

Would be glad if you guys can help me to solve my problem.

I uploaded my project to github. LINK

Using SDK 14.0.0.0 and Keil µVision.

Thank you

.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol textsize multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol rotation multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol wrap multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol WIDTH multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol HEIGHT multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol _width multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol _height multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol cursor_x multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol cursor_y multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol textcolor multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol textbgcolor multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol _drawPixel multiply defined (by main.o and adafruit_gfx.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol _i2caddr multiply defined (by main.o and ssd1306.o).
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol _vccstate multiply defined (by main.o and ssd1306.o).
Parents
  • In Adafruit_GFX.h the following file scope variables are defined

    int16_t WIDTH, HEIGHT; // this is the 'raw' display w/h - never changes int16_t _width, _height; // dependent on rotation int16_t cursor_x, cursor_y; uint16_t textcolor, textbgcolor; uint8_t textsize; uint8_t rotation;

    Two c modules, main.c and Adafruit_GFX.c, include the Adafruit_GFX.h in their include list and thus these file scope variables are defined twice, and that upsets the C compiler :(

    Try to move the definition for these variables into Adafruit_GFX.c (and make them "static" too) and see if you can compile successfully.

  • Thank you very much, I have done what you say (included for the other multiply defined symbols) And it worked!

    Problem solved!

Reply Children
No Data
Related