Error undefined reference

I'm trying to compile a hex file in MegaJoy . I do this in Mingw32 in LUFA-210130 and I have this error.

Linking: MegaJoy.elf
avr-gcc -mmcu=atmega16u2 -I. -gstabs -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=MegaJoy.o -std=gnu99 -MMD -MP -MF .dep/MegaJoy.elf.d MegaJoy.o --output MegaJoy.elf -Wl,-Map=MegaJoy.map,--cref -Wl,--relax -Wl,--gc-sections -lm
MegaJoy.o: In function main': MegaJoy.cpp:162: undefined reference to usb_init()'
MegaJoy.o: In function main': c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:124: undefined reference to usb_configured()'
MegaJoy.o: In function main': MegaJoy.cpp:247: undefined reference to sendControllerDataViaUSB(dataForMegaController_t, unsigned char)'
MegaJoy.cpp:249: undefined reference to `sendControllerDataViaUSB(dataForMegaController_t, unsigned char)'
make: *** [MegaJoy.elf] Error 1

Maybe someone could help me point out why this error appears.
I have already compiled hex files but I haven't had anything like this before

Have a quick read of the how to use the forum .
That code/error is not readable .

There are masses of issues being reported on your linked page , the txt also mentions re flashing the UNO’s USB chip , which you need to do , and is probably the cause of your errors .
All looks a bit “iffy” to me …think I’d make something else

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.