c++ - 在 iOS App 中使用 Swift 的 C++ 库

标签 c++ ios swift ginac

我想在 Swift 中使用 C++ 库:GiNaC .我看过有关如何在 Swift 中使用 C++ 库的教程,但我不知道这是否适用于 iOS 或如何处理依赖项。 GiNaC 有 CLN作为依赖。如何实现?

最佳答案

C++ .h 文件无法导入到 Swift Bridging Header 中,因为 Swift 仅与 C 或 Objective-C 不兼容

您可能需要使用您创建的 Objective-C 包装器来调用 C++ 函数,然后 Swift 可以调用您的 Objective-C 包装器公开的方法。

这个线程是相关的:Can I mix Swift with C++? Like the Objective-C .mm files

关于c++ - 在 iOS App 中使用 Swift 的 C++ 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42790460/

相关文章:

c++ - 在 Rcpp 中包装一个 Fortran 函数

c++ - 针对 MIPS 的 Microsoft Visual Studio 2010 编译

c++ - 全局静态对象销毁后,是否有可能调用OS计时器回调?

ios - CollectionViewCell 内向上移动标签动画

ios - WKWeb View : How to local storage enable in iOS8

c++ - Snow Leopard 上的链接错误

ios - 为什么我在 UI 自动化工具中看到 "An error occurred while trying to run the script."?

ios - Objective-C : Value of array inexplicably resets every time button is clicked

ios - 通用应用程序在 iPad 上不旋转,但在 iPhone 上旋转

ios - 如何在 Swift iOS 中更改单选按钮选定的图像和相应的文本