【发布时间】:2023-04-10 06:18:02
【问题描述】:
我正在尝试将这个 https://github.com/gareth-cross/kalman-ios 项目与我自己在 Xcode 中的 Swift 项目集成。
在构建项目时,我收到 2 个错误:
kalman-ios/matrix.hpp:28:10: error: 'cmath' file not found
failed to emit precompiled header
'/Users/.../Build/Intermediates.noindex/PrecompiledHeaders/Tron-iOS-Bridging-Header-
swift_J9ENU1M0P5CE-clang_M49XZJR5TLTE.pch'
for bridging header '/Users/.../Filter/Tron-iOS-Bridging-Header.h'
我的项目是纯 Swift,而 kalman-ios 项目是 ObjC 和 ObjC++ 的混合体。
我的桥接头文件是:
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "KFEstimator.h"
关于更多上下文,kalman-ios 项目的结构如下: KFEstimator.mm 调用 AttitudeESKF.cpp 调用 matrix.cpp
我最初的想法是 cmath 文件错误是导致桥接头错误的原因。但我几乎没有 Swift 以外的经验,也不知道如何修复它。直到昨天,我什至都不知道你可以使用 ObjCPP。
感谢任何帮助!
【问题讨论】:
-
我已经有几年没有这样做了,所以我对它的了解可能已经过时了,但是....我不知道它为什么要创建一个 ,pch。这与某些特定的构建步骤有关吗?
-
据我所知,它会根据桥接头文件中列出的文件创建一个 .pch。
标签: ios objective-c swift xcode objective-c++