Is it possible to load dynamic libraries on device?

I managed to link and load a dynamic library when using the simulator on macOS:

I'm wondering if this is possible on devices. I don't have a device yet so I can't experiment.

I'm hoping someone could provide some insight on that so I can consider moving forward using the simulator for now and figure out static build later.

I explained in the linked GitHub issue that I wasn't able to figure out how to modify the search paths for the simulator.

If anyone has any info on how to do that, I'd appreciate it.

As far as I remember FreeRTOS (the OS the Playdate runs) doesn't support dynamic linking, sadly.

1 Like

Thanks. I didn’t know about FreeRTOS.

I found an old support thread from 2011 that says the same.

The current C API loader requires code to be compiled for a specific address, but we do have a new loader in the works that does relocation. I think that's all we'll need in order to support dynamic libraries on the device, but no promises :slight_smile:

2 Likes

Thanks, thats good to know!

Creating a static library looks more promising than I first thought in this case, but still a non-zero amount of effort.

Dynamic library support would be good in general.

@dave it would help with this: Power Player: early look at a new emulator

:slightly_smiling_face:

1 Like