Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"image_data" multiple definition #2

Open
WesternGun opened this issue Oct 7, 2018 · 1 comment
Open

"image_data" multiple definition #2

WesternGun opened this issue Oct 7, 2018 · 1 comment

Comments

@WesternGun
Copy link

WesternGun commented Oct 7, 2018

I see an error:

 [LNK]     : Linking object files into "Joystick.elf"
avr-gcc Joystick.o Descriptors.o image.o ../LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o ../LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.o ../LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.o ../LUFA/LUFA/Drivers/USB/Core/Events.o ../LUFA/LUFA/Drivers/USB/Core/HostStandardReq.o ../LUFA/LUFA/Drivers/USB/Core/USBTask.o -o Joystick.elf -lm -Wl,-Map=Joystick.map,--cref -Wl,--gc-sections-Wl,--relax -mmcu=atmega32u4
image.o:(.progmem.data+0x0): multiple definition of `image_data'
Joystick.o:(.progmem.data+0x0): first defined here
e:/coding/environment/winavr/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
make: *** [Joystick.elf] Error 1

It seems like in image.c there is a image_data defined same as in Joystick.c, repeated name.
image.c:

const uint8_t image_data[0x12c1] PROGMEM = {...}

Joystick.c:

const uint8_t image_data[0x12c1] PROGMEM;

I changed the name in Joystick.c to something else and error gone, it compiles well. Should this be the fix? I am not sure because I am not familiar with C.

@WesternGun
Copy link
Author

No, it is not.

I google a bit and then look into this repo of:

https://github.com/LightningStalker/Splatmeme-Printer

which works totally for me, where it has Joystick.c like extern const. So it should be the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant