You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 05:24:53