Currently I’m working on a project, where I use a precompiled static Library, for an ARM Cortex M0. Therefore I used the Arduino M0 Pro.
I did follow the instructions this page:
But when i try to compile my code, I get the following error:
Arduino: 1.8.7 (Windows 10), Board: "Arduino M0 Pro (Native USB Port)"
Build options changed, rebuilding all
sketch\sketch_dec04d.ino.cpp.o: In function setup': C:\Users\LED2BE\AppData\Local\Temp\arduino_modified_sketch_247230/sketch_dec04d.ino:5: undefined reference to a_init'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino M0 Pro (Native USB Port).
Thats the Sourcecode i used:
#include <access.h>
void setup() {
a_init();
}
void loop() {
}
The function a_init() is defined in the headerfile, so that shouldn't be the problem.
That's structure of the folder i saved the library in:
libaccess
libaccess/library.properties
libaccess/src/access.h
libaccess/src/cortex-m0plus/access.a
That's the content of the library.properties file i wrote.
name=libaccess
version=1.0.0
author=David_Niklas
maintainer=David Leiting David-Niklas@gmail.de
sentence=A library for a Keyless System.
paragraph=For verifing ID.
category=Communication url=www.google.com
architectures=*
include=access.h
precompiled=true
ldflags=-lm
Do you know what i do wrong?
It would be great if you could help me.
Please provide either a link to where we can download the library or else attach the library here on the forum. If you click the "Reply" button, you'll see an "Attachments and other settings" button.
I see one of the Arduino developers helped you resolve the problem on the Arduino bug tracker:
You had asked a question about defining multiple ldflags:
If i do have multiple libraries: libaccess2.a libaccess2.a libaccess3.a libaccess4.a
Do I need to write the ldflags in the library.propertie file like that?
A single flag with ldflags=-laccess1 -laccess2 -laccess3 ... (comma separated) will work
What's confusing my is that faccinm gave the example like this:
ldflags=-laccess1 -laccess2 -laccess3
but then said "comma separated", which would imply it should actually be like this:
ldflags=-laccess1,-laccess2,-laccess3
Which one is correct. The reason I'm asking is because the Arduino Library Specification doesn't mention that ldflags can take a comma separated list. I'd like to document this so that others won't have the same confusion you did, but I want to be sure I have it right.