After installing Arduino 1.6.1, then Teensyduino 1.21, the Arduino IDE works fine. However,
Visual Micro for
Visual Studio 2013 Community Edition displays the following error message:
"C:\arduino/hardware/tools/arm/bin/arm-none-eabi-gcc" -Os -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=15933683 "-TC:\arduino\hardware\teensy\avr\cores\teensy3/mk20dx256.ld" {build.flags.ldspecs} -mthumb -mcpu=cortex-m4 -o lf" pp.o" "C:\Users\martin\AppData\Local\V.Micro\Arduino\Builds\bot-coc\teensy31/core.a" "-LC:\Users\martin\AppData\Local\V.Micro\Arduino\Builds\bot-coc\teensy31" -larm_cortexM4l_math -lm
arm-none-eabi-gcc*:error: {build.flags.ldspecs}: No such file or directory
Error creating .elf
It appears the
{build.flags.ldspecs} macro defined in
Arduino\hardware\teensy\avr\boards.txt has not been correctly replaced on the command line by
Visual Micro.
The workaround I've found is to edit the contents of
Arduino\hardware\teensy\avr\platform.txt, replacing:
## Link
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.gcc}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" {build.flags.libs}
with:
## Link
## recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.gcc}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" {build.flags.libs}
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.gcc}" {build.flags.optimize} {build.flags.ld} --specs=nano.specs {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" {build.flags.libs}
As you can see, I've just replaced
{build.flags.ldspecs} with
--specs=nano.specs as suggested in
Arduino\hardware\teensy\avr\boards.txt.
Is it a way to fix it in a more conventional way?
This same bug has already been reported here in a previous
Visual Micro version.