How I can add precompiled library ".a" to the project

Hello Everyone, I am working on a project to get IAQ values from the (ZMOD4410), They provided and example code which works fine, also they provided some precompiled libraries, I want to include those precompiled libraries to the project.
They suggests if the sensor don’t achieved best performance then it should need cleaning, they provided a precompiled library libzmod4xxx_cleaning.a which I want to used:
1- Include the respective header file
2- and call the cleaning_method
But once I clicked on compile, the error occurs that undefined reference to the function cleaning_method.
I have followed this link (Using a precompiled library *.a ) but unable to solve the problem.

compilation error:

please help me.
Thanks

What’s the full platformio.ini? In which folder in the .a file?

Here it is.

Is the library written in C? Did you include it with a

extern "C" {
#include "atmega328p/libzmod4xxx_cleaning.h"
}

code whereever ypu use it?

1 Like

Thanks, I had exact same problem.
marking the library as C solved the issue and allowed the linker to complete