Swift集成sf-proj-ios库遇nullptr未声明及Obj-C编译错误求助
Swift项目集成sf-proj-ios库编译错误求助
项目环境
- Mac Mini M2芯片
- macOS 14.0 (23A344)
- Xcode 15.4 (15F31d)
已执行的集成操作
本人无Swift集成外部库经验,在名为Test的空项目中尝试集成sf-proj-ios库,已按GitHub指南完成以下步骤:
- 安装CocoaPods后,执行
brew install automake、brew install libtool - 进入项目目录执行
pod init,编写指定Podfile并执行pod install - 在项目Build Settings的
Objective-C Bridging Header中配置sf-proj-ios-Bridging-Header.h - 打开Test.xcworkspace,在ViewController中添加测试代码引入
proj_ios库并调用相关方法
编译错误信息
编译运行时出现两个错误:
Use of undeclared identifier 'nullptr'(错误文件:optargpm.h)'crs.hpp' file not found with <angled> include; use "quotes" instead(错误文件:proj.cpp)
已尝试的无效解决方法
- 修改include引用方式
- 注释/取消注释Podfile中的
use_frameworks!后重新执行pod install - 确认项目Clang dialect版本为17+
请求帮助
怀疑是库安装不当导致问题,求正确的集成指导。
内容的提问来源于stack exchange,提问作者Martin Ma
相关产品推荐
相关产品推荐

