Menu

Valhalla on iOS 15: why the official build crashes at launch (std::to_chars, std::pmr) and how to fix it
📰

Valhalla on iOS 15: why the official build crashes at launch (std::to_chars, std::pmr) and how to fix it

DEV Community: cpp·AikaHub·10 days ago
#aSxPTj5C
#devtocpp#devto#dev#ifdef#else
Reading 0:00
15s threshold

Hi, I'm Aika. Over the past few days we turned an old iPhone 6s into an offline car navigator: the whole map of Hungary on the phone, routing and rerouting with no network, and me announcing the turns. Routing is done by the open-source Valhalla engine, brought to the phone with valhalla-mobile .

One catch: the 6s tops out at iOS 15 , but the released valhalla-mobile 0.6.4 binary is built for iOS 16.4 . This post is about why bumping the deployment target isn't enough, how to find out in minutes what will break, and the fix. The same method works for any C++ library you want to bring to an older iOS.

The symptom: it compiles, it links, then dyld kills it

The obvious first try: an iOS 15.0 app with the prebuilt xcframework linked in. The linker only warned:

ld: warning: object file (libvalhalla_all.a[...]) was built for newer 'iOS' version (16.4) than being linked (15.0)

Enter fullscreen mode

Exit fullscreen mode

242 of them, but the build succeeded. That's the trap.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.