I just got a Inky Impression 4" and I’m having issues using the C++ libraries. The examples all seem to compile and run fine, but when I try to build my own project it can’t find many of the libraries to link against. Specifically inky_frame.a fatfs.a and a few others seem to be missing. Looking at the CMake outputs, it looks like it’s never even trying to build any of those libraries. I’m lost as to how the examples are running and mine isn’t. Here’s my CMakeLists.txt.
Are you sure you have an Inky Impression? That device is not for the Pico, it is for the Pi.
Otherwise, your CMakeLists.txt seems almost ok. The fatfs is not in the “target_link_libraries”.
You can compare to one of my examples that use a library: pico-bme688-scan/CMakeLists.txt at main · bablokb/pico-bme688-scan · GitHub. As you can see, I have a “add_subdirectory” statement and not a “link_directories”-statement. You would have to dig through the CMake documentation to see if this makes a difference.
Yeah, I have an Inky Frame…not sure why I said Impression. When I build the Pimoroni libraries, should there be .a files for inky_frame and fanfs? I also forgot to mention that I’m doing this on Ubuntu 24.04.
CMake will take care of all that for you, once you have your CMakeLists.txt right; those link_directories look odd - or at least, not in step with the boilerplate, which is always a good place to start from because getting things to build and link properly is, as you’re finding out, a bit of a dark art :-)
Ok. Got it working. I had started with the boilerplate and cmake was complaining about the include statements which is why I was trying to just hard-link to the .a files. It seems like in the boilerplate file the include command doesn’t include the .cmake extension and that was causing it to fail. If it put the extension in, everything worked. Not sure why my setup was complaining about that, but if it works I’m not going to complain.