Tutorial on Consuming C++ Code/Library

Hi, just discovered Chris’ amazing channel. It has everything i need to start making iOS App. Thank you for sharing your videos, Chris.

I was redirected to this forum and this is my first post. I tried searching first for similar posts but it looks like a separate post is needed.

Would any of you have links to tutorial about how to consume C++ code/library in swift ? I have a complex console application (about Structural Analysis) that I want deployed on iOS (and hopefully, also Android) and i don’t want to port everything in Swift (or Kotlin). I want the my core engine to be in C++ and Swift for the frontend.

Right now, I’m half-way Chris’ tutorial for Beginners and really learning so much but really hoping to learn soon about how to pass data between C++ code/objects and Swift classes (?). Any leads would be greatly appreciated. Thanks in advance.

Eric

Welcome to the community Eric!

So your C++ application, is that a desktop application? I’m confused what “console application” means?

1 Like

Ah yes, thank you. It’s a MacOS Command Line Application (Tool). No GUI. Data is read from a file and results are exported to a CSV-file. I plan to utilize the C++ library and number-crunching source codes in C++ and the GUI front-end in platform-specific languages.

A friend suggested to create wrapper classes in Swift as well as some conversion to Objective-C but I need more help about how to do it that’s why I’m looking for tutorials here.

Any help will be appreciated.