Link an external static object archive (.a)
Posted: Fri Dec 13, 2019 4:53 am
Hi,
I hope this hasn't been answered before. I tried to search the forum but the page timed out before I got any results. Anyway...
I have a third-party library developed with autotools instead of CMake. I was able to successfully configure and build it with the xtensa-esp32 toolset that comes along with ESP-IDF. Now, for the life of me, I can't figure out how to get it linked in with the rest of my main IDF project. It seems like such a simple goal: an additional .a file included in the linker command. But I've tried everything I can think of and it always winds up in one of two places: Either CMake fails to finish generating the build scripts, or the link fails with undefined symbols. So let's say I have, in my "components" directory, a directory called "freetype" which contains all the relevant headers, and a static library file libfreetype.a. How do I get that fed into the linker under the ESP-IDF system?
If you're wondering why I'd even bother trying to link FreeType into my ESP32 project... My project includes a small graphical OLED display which communicates over SPI. At the hardware level, I've got that all working perfectly. But that display driver doesn't have a character ROM; it's purely graphical. I thought I might try using FreeType to handle rendering characters, and embed a .ttf font in the binary. Embedding stuff is easy (EMBED just works).
Anyway, thanks!
I hope this hasn't been answered before. I tried to search the forum but the page timed out before I got any results. Anyway...
I have a third-party library developed with autotools instead of CMake. I was able to successfully configure and build it with the xtensa-esp32 toolset that comes along with ESP-IDF. Now, for the life of me, I can't figure out how to get it linked in with the rest of my main IDF project. It seems like such a simple goal: an additional .a file included in the linker command. But I've tried everything I can think of and it always winds up in one of two places: Either CMake fails to finish generating the build scripts, or the link fails with undefined symbols. So let's say I have, in my "components" directory, a directory called "freetype" which contains all the relevant headers, and a static library file libfreetype.a. How do I get that fed into the linker under the ESP-IDF system?
If you're wondering why I'd even bother trying to link FreeType into my ESP32 project... My project includes a small graphical OLED display which communicates over SPI. At the hardware level, I've got that all working perfectly. But that display driver doesn't have a character ROM; it's purely graphical. I thought I might try using FreeType to handle rendering characters, and embed a .ttf font in the binary. Embedding stuff is easy (EMBED just works).
Anyway, thanks!