Go Down

Topic: dot_a_linkage | error: libraries\dotATest\dotATest.a: No such file or directory (Read 327 times) previous topic - next topic

aliebold

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:

dotATest.h
Code: [Select]
#ifndef DOTATEST_H
#define DOTATEST_H

int multiplyBy2(int x);

#endif /* End DOTATEST_H */


dotATest.cpp
Code: [Select]
#include "dotATest.h"

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


I compile the .cpp file with the command:

Code: [Select]
g++ -c dotATest.cpp -o dotATest.o

Then I archive the .o file with this command:

Code: [Select]
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.

library.properties
Code: [Select]
name=dotATest
version=1.0.0
author=Aaron Liebold
maintainer=Aaron Liebold
sentence=A simple library to test the dot_a_linkage
paragraph=
category=Data Processing
dot_a_linkage=true
url=
architectures=*
include=dotATest.h


I am testing the use of the library with the following sketch:
Code: [Select]
#include <dotATest.h>

void setup() {
  // put your setup code here, to run once:
  Serial.begin(2000000);
}

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


And when it compiles I get the following error:
Code: [Select]
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 library.properties? Any insights would be helpful.

Thanks,
Aaron

Go Up