How to build a C++ code of an Open Source programm for Teensy 2.0 ?

Hello,

I'm new to programming with microprocessors and for a project I'm trying to recreate the vicar-device from Brandon Wilson ( git-code )

I finished preparing the hardware and now I'm trying to falsh the code on the Teensy 2.0 with the USB Host Shield.

In the README Brandon wrote:

You can build the Teensy code with the Atmel AVR toolchain on Windows.

So I downloaded it from here, however I'm quite overwhelmed with the files in there and no concrete indication on how to use which file.
So I continued my search and read somewhere, that the Atmel Studio also support the Atmel AVR toolchain, so I installed it.

The Atmel Studio don't see it as a project and hence I can't build the code.

So I looked for other possibilites and noticed the makefile. After I googled it, I found a Teensy tutorial. I managed to put the "Blinky" program on the Teensy board and then tried to compile the vicar code.
Unfortunately I keep getting an error. (Due to exceeding the maximum alloud length of 9000 characters, I will add the console output as the first comment)

Now I'm lost and don't know what to do or how.
Does anyone has a suggestion for alternatives to WinAVR and Atmel AVR toolchain or an explanation on how to use the Atmel toolchain?

Here is the complete console output when trying to use the makefile

c:\Users\sankai\Documents\vicar-master\vicar-master\vicar_teensy>make
 [INFO]    : Begin compilation of project "vicar"...

avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 [OBJCPY]  : Extracting HEX file data from "vicar.elf"
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature vicar.elf vicar.h
ex
avr-objcopy:vicar.elf: File format not recognized
make: *** [vicar.hex] Error 1

c:\Users\sankai\Documents\vicar-master\vicar-master\vicar_teensy>make
 [INFO]    : Begin compilation of project "vicar"...

avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 [GCC]     : Compiling C++ file "vicar.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
vicar.d vicar.cpp -o vicar.o
In file included from vicar.cpp:6:
descriptors.h:3: warning: only initialized variables can be placed into program
memory area
descriptors.h:7: warning: only initialized variables can be placed into program
memory area
descriptors.h:9: warning: only initialized variables can be placed into program
memory area
descriptors.h:11: warning: only initialized variables can be placed into program
 memory area
descriptors.h:17: warning: only initialized variables can be placed into program
 memory area
descriptors.h:26: warning: only initialized variables can be placed into program
 memory area
descriptors.h:30: warning: only initialized variables can be placed into program
 memory area
descriptors.h:42: warning: only initialized variables can be placed into program
 memory area
descriptors.h:44: warning: only initialized variables can be placed into program
 memory area
descriptors.h:45: warning: only initialized variables can be placed into program
 memory area
descriptors.h:47: warning: only initialized variables can be placed into program
 memory area
descriptors.h:51: warning: only initialized variables can be placed into program
 memory area
./pins.h:326: warning: 'void turnOffPWM(uint8_t)' defined but not used
 [GCC]     : Compiling C++ file "Max3421e.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
Max3421e.d Max3421e.cpp -o Max3421e.o
pins.h:326: warning: 'void turnOffPWM(uint8_t)' defined but not used
 [GCC]     : Compiling C++ file "Usb.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
Usb.d Usb.cpp -o Usb.o
Usb.cpp: In member function 'URB* USB::findUrb(uint32_t)':
Usb.cpp:76: warning: comparison between signed and unsigned integer expressions
Usb.cpp: In member function 'void USB::flushCompletedUrbs()':
Usb.cpp:107: warning: comparison between signed and unsigned integer expressions

Usb.cpp: In member function 'uint8_t USB::cancelUrb(uint32_t)':
Usb.cpp:124: warning: comparison between signed and unsigned integer expressions

Usb.cpp: In member function 'void USB::processUrbs(void (*)(uint8_t, void*))':
Usb.cpp:141: warning: comparison between signed and unsigned integer expressions

Usb.cpp: In member function 'uint8_t USB::urbInTransfer(uint32_t, long unsigned
int*, void (*)(uint8_t, void*), unsigned int)':
Usb.cpp:475: warning: suggest parentheses around assignment used as truth value
Usb.cpp: In member function 'uint8_t USB::configureEndpoint(uint8_t, uint8_t, ui
nt8_t)':
Usb.cpp:201: warning: control reaches end of non-void function
./pins.h: At global scope:
./pins.h:326: warning: 'void turnOffPWM(uint8_t)' defined but not used
 [GCC]     : Compiling C++ file "pins.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
pins.d pins.cpp -o pins.o
pins.cpp:6: warning: only initialized variables can be placed into program memor
y area
 [GCC]     : Compiling C++ file "msd.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
msd.d msd.cpp -o msd.o
msd.cpp: In function 'void _HandleMassStoragePacket()':
msd.cpp:38: warning: unused variable 'retCode'
 [GCC]     : Compiling C++ file "lufa.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
lufa.d lufa.cpp -o lufa.o
In file included from lufa.cpp:5:
descriptors.h:3: warning: only initialized variables can be placed into program
memory area
descriptors.h:7: warning: only initialized variables can be placed into program
memory area
descriptors.h:9: warning: only initialized variables can be placed into program
memory area
descriptors.h:11: warning: only initialized variables can be placed into program
 memory area
descriptors.h:17: warning: only initialized variables can be placed into program
 memory area
descriptors.h:26: warning: only initialized variables can be placed into program
 memory area
descriptors.h:30: warning: only initialized variables can be placed into program
 memory area
descriptors.h:42: warning: only initialized variables can be placed into program
 memory area
descriptors.h:44: warning: only initialized variables can be placed into program
 memory area
descriptors.h:45: warning: only initialized variables can be placed into program
 memory area
descriptors.h:47: warning: only initialized variables can be placed into program
 memory area
descriptors.h:51: warning: only initialized variables can be placed into program
 memory area

Part 2

lufa.cpp: In function 'uint8_t LUFA_Receive(uint8_t, uint8_t*, int)':
lufa.cpp:45: warning: no return statement in function returning non-void
lufa.cpp: In function 'uint16_t CALLBACK_USB_GetDescriptor(uint16_t, uint8_t, co
nst void**)':
lufa.cpp:259: warning: comparison between signed and unsigned integer expression
s
lufa.cpp: In function 'void EVENT_USB_Device_ControlRequest()':
lufa.cpp:397: warning: unused variable 'res'
lufa.cpp:496: warning: comparison between signed and unsigned integer expression
s
lufa.cpp:539: warning: comparison between signed and unsigned integer expression
s
lufa.cpp:539: warning: comparison between signed and unsigned integer expression
s
lufa.cpp: In function 'uint8_t LUFA_Receive(uint8_t, uint8_t*, int)':
lufa.cpp:45: warning: control reaches end of non-void function
./pins.h: At global scope:
./pins.h:326: warning: 'void turnOffPWM(uint8_t)' defined but not used
 [GCC]     : Compiling C++ file "sendrecv.cpp"
avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=atmega32u4 -fshort-enums -fno-inline-small-
functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bi
tfields -ffunction-sections -I. -I../LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_TEEN
SY2 -DF_USB=16000000UL -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c++ -Os -s
td=gnu++98 -DUSB_STREAM_TIMEOUT_MS=250 -DUSE_STATIC_OPTIONS="USB_DEVICE_OPT_FULL
SPEED|USB_OPT_REG_ENABLED|USB_OPT_AUTO_PLL" -DUSB_DEVICE_ONLY -DFIXED_CONTROL_EN
DPOINT_SIZE=64 -DFIXED_NUM_CONFIGURATIONS=1 -DUSE_RAM_DESCRIPTORS  -MMD -MP -MF
sendrecv.d sendrecv.cpp -o sendrecv.o
sendrecv.cpp: In function 'void _HandleVicarPacket()':
sendrecv.cpp:161: warning: comparison between signed and unsigned integer expres
sions
sendrecv.cpp:188: warning: comparison between signed and unsigned integer expres
sions
sendrecv.cpp:274: warning: left shift count >= width of type
sendrecv.cpp:274: warning: left shift count >= width of type
./pins.h: At global scope:
./pins.h:326: warning: 'void turnOffPWM(uint8_t)' defined but not used
 [LNK]     : Linking object files into "vicar.elf"
avr-gcc vicar.o Max3421e.o Usb.o pins.o msd.o lufa.o sendrecv.o ../LUFA/Drivers/
USB/Class/Common/HIDParser.o ../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o ../LUFA
/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o ../LUFA/Drivers/USB/Core/AVR8/Endpo
int_AVR8.o ../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o ../LUFA/Drivers/USB/Core/AV
R8/PipeStream_AVR8.o ../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o ../LUFA/Drivers/U
SB/Core/AVR8/USBController_AVR8.o ../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR
8.o ../LUFA/Drivers/USB/Core/ConfigDescriptors.o ../LUFA/Drivers/USB/Core/Device
StandardReq.o ../LUFA/Drivers/USB/Core/Events.o ../LUFA/Drivers/USB/Core/HostSta
ndardReq.o ../LUFA/Drivers/USB/Core/USBTask.o -o vicar.elf -lm -Wl,-Map=vicar.ma
p,--cref -Wl,--gc-sections -Wl,--relax -mmcu=atmega32u4
c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: BFD (Win
AVR 20100110) 2.19 internal error, aborting at ../../binutils-2.19/bfd/reloc.c l
ine 446 in bfd_get_reloc_size

c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: Please r
eport this bug.

make: *** [vicar.elf] Error 1

c:\Users\sankai\Documents\vicar-master\vicar-master\vicar_teensy>