So I've wasted a week trying to get this to work and figure it's time to ask for help. I'm a C neophyte so this is my first time using things like make and Makefile, which at the moment is mostly voodoo to me.
I'm trying to build and include a C library, but no matter what I try I get this error:
arm-none-eabi-gcc: error: libchipmunk: No such file or directory
Here are my steps:
- My project currently is just a copy of the HelloWorld example that comes with the SDK
- I download this repo from github: GitHub - samdze/chipmunk-2d: A fast and lightweight 2D game physics library with added Playdate support.
- I install it in at the root of my project, ie /project/chipmunk
- I follow the instructions in the README to build either a dynamic or a static library, which gives me /project/chipmunk/src/libchipmunk (either .dylib or .a respectively)
- In the project Makefile I update the following lines:
# List the user directory to look for the libraries here
ULIBDIR = chipmunk/src
# List all user libraries here
ULIBS = libchipmunk
- In src/main.c I add: #include "chipmunk.h" to test that everything is linked correctly after the build
- I then run make from the project root, and I get the error at the top of the thread.
- I have also tried other variations like ULIBS = chipmunk/src/libchipmunk since I noticed the SRC variable needs the full relative path, but that didn't fix it.
It feels like ULIBDIR and ULIBS are the two variables I should be updating to get make to link the library, but I have not seen any example playdate project Makefiles where someone is including a library so I'm not sure.