dot_a_linkage | error: libraries\dotATest\dotATest.a: No such file or directory

I am attempting to use the dot_a_linkage feature in a simple test library and the compiler is throwing an error saying that it can not find the .a file exactly where it is located and named. I have tried putting the .a file in the src folder and the root (and both…).

Here is the library:


#ifndef DOTATEST_H
#define DOTATEST_H

int multiplyBy2(int x);

#endif /* End DOTATEST_H */


#include "dotATest.h"

int multiplyBy2(int x) {
	return 2*x;

I compile the .cpp file with the command:

g++ -c dotATest.cpp -o dotATest.o

Then I archive the .o file with this command:

ar crf dotATest.a dotATest.o

Then I create a v1.5 library structure with dotATest.h and dotATest.a in the src folder and a library properties file in the root directory.

author=Aaron Liebold
maintainer=Aaron Liebold
sentence=A simple library to test the dot_a_linkage
category=Data Processing

I am testing the use of the library with the following sketch:

#include <dotATest.h>

void setup() {
  // put your setup code here, to run once:

void loop() {
  if (millis()%1000 == 0) {
    Serial.print(millis() % 1000);
    Serial.print(" x 2 = ");
    Serial.print(multiplyBy2((int) millis() % 1000));

And when it compiles I get the following error:

Arduino: 1.8.10 (Windows 10), Board: "Arduino/Genuino Uno"


Using previously compiled file: C:\Users\Aaron\AppData\Local\Temp\arduino_build_884537\core\core.a
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\Aaron\\AppData\\Local\\Temp\\arduino_build_884537/dotOTestSketch.ino.elf" "C:\\Users\\Aaron\\AppData\\Local\\Temp\\arduino_build_884537\\sketch\\dotOTestSketch.ino.cpp.o" "C:\\Users\\Aaron\\AppData\\Local\\Temp\\arduino_build_884537\\libraries\\dotATest\\dotATest.a" "C:\\Users\\Aaron\\AppData\\Local\\Temp\\arduino_build_884537/core\\core.a" "-LC:\\Users\\Aaron\\AppData\\Local\\Temp\\arduino_build_884537" -lm
avr-gcc: error: C:\Users\Aaron\AppData\Local\Temp\arduino_build_884537\libraries\dotATest\dotATest.a: No such file or directory

Multiple libraries were found for "dotATest.h"
 Used: C:\Working_Files_LOCAL\Arduino\libraries\dotATest
Using library dotATest at version 1.0.0 in folder: C:\Working_Files_LOCAL\Arduino\libraries\dotATest 
exit status 1
Error compiling for board Arduino/Genuino Uno.

I checked the AppData\Local\Temp\arduino_build_884537\libraries\dotATest folder and it was empty. It seems that dotATest.a is not being moved into the temp directory for the compilation. Is something not set correction in my Any insights would be helpful.


1 Like