I want to use a C++ library in Swift: GiNaC. I have seen tutorials on how to use C++ libraries in Swift but I do not know if this will work for iOS or how to deal with dependencies. GiNaC has CLN as a dependency. How to achieve this?
Asked
Active
Viewed 3,767 times
1 Answers
2
C++ .h files cannot be imported in a Swift Bridging Header because Swift is not compatible with C++ only with C or Objective-C
You will probably need to use an Objective-C wrapper you create to call the C++ functions, then Swift can call the methods exposed by your Objective-C wrapper.
This thread is relevant : Can I mix Swift with C++? Like the Objective-C .mm files

Rocket Garden
- 1,166
- 11
- 26