Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How to cross-compile protobuf for iOS C++ runtime?

40 views
Skip to first unread message

Arjun Patel

unread,
Mar 20, 2025, 3:18:56 AMMar 20
to Protocol Buffers
I have been researching everywhere how to get a simple Qt/C++ project to use protobuf on macOS AND iOS. I need to use protobuf runtime for my app to work, not merely generate C++ headers/source.

For MacOS, I was able to simply download, build, and install grpc and then make my `CMAKE_PREFIX_PATH` point there. This worked as expected.

Of course I got some "wrong architecture" errors when I built for iOS. I still don't quite know how to make this work for iOS. 

I have looked through multiple resources, but they seem outdated:

I am a beginner in the Xcode/Apple as well as C++ in general. So perhaps I am missing some obvious method here.
- Should I be using Xcode to build protobuf from source?
- Should I be cross compiling with some specific cmake instructions, slightly modifying the instructions here in some manner?

Thanks for the help!

Best,
Arjun

Deanna Garcia

unread,
Mar 25, 2025, 4:56:38 PMMar 25
to Protocol Buffers

Thanks for the question! Unfortunately cross-compiling protobuf from source can be pretty difficult (particularly for iOS). Is there a reason you want to build from source instead of just using our pre-built protoc binaries provided in our releases page?

Deanna

Reply all
Reply to author
Forward
0 new messages