Linking Generic Static Libraries (.a)

Hello,

I understand this question has been asked before, but I'd like to inquire about something the GitHub docs say about linking static libraries. I am using the VSCode Particle Workbench.

I currently have some static libraries I'd like to link to my user application. The GitHub docs say this about linking libraries.

It looks to me like I should be able to tell the build system where my .a files are using the circled Makefile variables.

This is my source tree and custom makefile.

Adding additional include directories work! But additional libraries don't. Any way to add custom libraries?

To be more specific, I get "symbol is undefined" errors.

Thank you.

The instructions in the Github only apply to the build.mk in the Device OS source tree, not the one in your user application. While compiler options specified in the user build.mk, like CFLAGS, can be set, linker options cannot.

The workarounds in the forum basically involve adding your custom .a to the Device OS user binary build.mk, where it is picked up for linking. But that has the bad side effects of linking your .a into every binary that you build with that version of Device OS.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.