旧项目在xcode10遇到的问题

栏目: IOS · 发布时间: 5年前

内容简介:修改 Xcode 的配置暂时解决了编译报错的问题。Xcode10不支持

1、 Multiple commands produce

Multiple commands produce '/

方案一

修改 Xcode 的配置暂时解决了编译报错的问题。

Xcode -> File -> Workspace settings -> Build System ,选择 Legacy Build System

方案二

  1. 选择打开所在的项目 Target -> Build Phases -> Copy Bundle Resources

  2. 删除报错的那些文件

2. library not found for -lstdc++.6.0.9

Xcode10不支持 libstdc++ 系列的库了、需要删掉并且换成 libc++ 系列的库。有些第三方由于没有更新,会牵扯到这个库,所以运行后报错。

方案一

打开 Build Phases -> Link Binary With Libraries ,删除 lstdc++.6.0.9 依赖

有可能还有删除 Build Setting -> Other Linker Flags 里的 -l"stdc++.6.0.9"

但是现在部分第三方SDK依旧要依赖于 lstdc++.6.0.9.tbd 动态库,如果对代码进行改动或者修改 Xcode 的配置,可能会造成其他问题,例如在Xcode9.4上再次运行的时候可能会出现报错等等。

方案二

最简单解决该问题的方法就是从 Xcode9.4 中找到动态库 lstdc++.6.0.9.tbdlibstdc++.6.tbdlibstdc++.tbd 文件复制到 Xcode10 下就可以完美解决问题。

  • 真机

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
  • 模拟器

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

libstdc++文件下载链接

3. ld: symbol(s) not found for architecture x86_64

前面两个问题解决后,就遇到了这个问题,目前,用xcode10 在iOS12模拟器运行的时候会报这个错误,用iOS11模拟器试过也不行,而使用真机运行的话没有问题。

Undefined symbols for architecture x86_64:
  "std::basic_string<char, std::char_traits, std::allocator>::basic_string(char const*, std::allocatorconst&)", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::string::assign(std::string const&)", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::basic_fstream<char, std::char_traits>::open(char const*, std::_Ios_Openmode)", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::basic_fstream<char, std::char_traits>::close()", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::string::_Rep::_S_empty_rep_storage", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::ios_base::Init::~Init()", referenced from:
      __GLOBAL__sub_I_BVMDOfflineMapMerge.cpp in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::basic_fstream<char, std::char_traits>::~basic_fstream()", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::string::_Rep::_M_destroy(std::allocatorconst&)", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::ostream::tellp()", referenced from:
      _baidu_framework::MergeDataPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, _baidu_framework::tagVectorMapFile&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::ostream::write(char const*, long)", referenced from:
      _baidu_framework::MergeNamePart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeIndexPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeDataPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, _baidu_framework::tagVectorMapFile&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::istream::seekg(long long, std::_Ios_Seekdir)", referenced from:
      _baidu_framework::MergeIndexPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeDataPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, _baidu_framework::tagVectorMapFile&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::CheckPatchMd5(std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::ios_base::Init::Init()", referenced from:
      __GLOBAL__sub_I_BVMDOfflineMapMerge.cpp in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::basic_fstream<char, std::char_traits>::basic_fstream()", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::istream::tellg()", referenced from:
      _baidu_framework::MergeNamePart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeIndexPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeDataPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, _baidu_framework::tagVectorMapFile&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::CheckPatchMd5(std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::__throw_length_error(char const*)", referenced from:
      std::vector<_baidu_vi::CVPtrRef, std::allocator<_baidu_vi::CVPtrRef> >::_M_fill_insert(__gnu_cxx::__normal_iterator<_baidu_vi::CVPtrRef*, std::vector<_baidu_vi::CVPtrRef, std::allocator<_baidu_vi::CVPtrRef> > >, unsigned long, _baidu_vi::CVPtrRefconst&) in BaiduMapAPI_Map(TextureDataLoader.o)
  "std::istream::read(char*, long)", referenced from:
      _baidu_framework::MergeNamePart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeIndexPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::MergeDataPart(std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, std::basic_fstream<char, std::char_traits>&, _baidu_framework::tagVectorMapFile&, int) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::CheckPatchMd5(std::basic_fstream<char, std::char_traits>&) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
  "std::basic_filebuf<char, std::char_traits>::is_open() const", referenced from:
      _baidu_framework::HandleBasemapMerge(_baidu_vi::CVString const&, _baidu_vi::CVString const&, _baidu_vi::CVString const&, char const*) in BaiduMapAPI_Map(BVMDOfflineMapMerge.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Java Web整合开发王者归来

Java Web整合开发王者归来

刘京华 / 清华大学 / 2010-1 / 99.80元

《Java Web整合开发王者归来(JSP+Servlet+Struts+Hibernate+Spring)》全面介绍了Java Web开发中的各种相关技术及知识。全书分为9篇,内容层次清晰,难度循序渐进。第1篇为入门篇,内容包括Java Web开发概述等;第2篇为基础篇,内容包括Servlet技术、JSP技术、会话跟踪、过滤器Filter、监听器Listener等;第3篇为高级篇,内容包括JST......一起来看看 《Java Web整合开发王者归来》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具