I would like to use precompiled libraries to reduce compile times with Arduino IDE 2.2.1. I posted this question on an Arduino forum, and someone suggested this is a toolchain issue because it works as expected with an atmega328p.
I’ve read the Arduino CLI Library Specification, searched the Arduino and Sparkfun forums, and Google, for “precompiled library”, “The platform does not support ‘compiler.libraries.ldflags’”, found numerous posts about fixing it, but nothing I’ve tried has worked.
The target board is a Sparkfun Redboard Artemis ATP (aka apollo3).
I have a simple test.ino program that includes one library to test with:
#include <Utils.h>
void setup() {
}
void loop() {
}
The compiler finds my library no problem. This is a snipet of what I get in the output window:
[…]
Compiling libraries…
Compiling library “Utils Library”
Library Utils Library has been declared precompiled:
Using precompiled library in d:\Projects\Arduino\libraries\Utils\src
The platform does not support ‘compiler.libraries.ldflags’ for precompiled libraries.
[…]
In libraries\Utils I have these files/folders:
src (folder)
library.properties
library.properties contains this:
name=Utils Library
version=0.0.0
author=lahr
maintainer=lahr <lahr@~~~~~~.~>
sentence=Utils Library
paragraph=Provides Common GP Utilities
category=Other
url=
architectures=*
depends=
dot_a_linkage=true
precompiled=full
In the src folder I have these files:
libUtils.a
Utils.cpp
Utils.h
I’ve searched my C: drive for every instance of platform.txt and copied a platform.local.txt file into those folders that contains this line:
compiler.libraries.ldflags=
When that didn’t fix it I also tried editing every platform.txt file to add the above line, and to modify the recipe.c.combine.pattern line:
recipe.c.combine.pattern=“{compiler.gcc.cmd}” “-T{build.ldscript}” “-Wl,-Map,{build.path}/{build.project_name}.map” -o “{build.path}/{build.project_name}.axf” {object_files} {libs.all} {compiler.ld.flags} {compiler.libraries.ldflags} {defines.ld}
I have spent many hours chasing this problem, and no change. Is it possible to do this with IDE v2.2.1?
Thanks!
Larry