日常消灭警告,遇到问题如下
ld: warning: object file (/Users/wanglizhi/wanglizhi/workspace/特运通/特运通/特运通/gaode/MAMapKit.framework/MAMapKit(MAMapKit-arm64-master.o)) was built for newer iOS version (11.1) than being linked (7.0)
ld: warning: direct access in function 'sgi::hashtable<sgi::pair<int const, signed char>, int, sgi::hash<int>, sgi::_Select1st<sgi::pair<int const, signed char> >, sgi::equal_to<int>, sgi::allocator<signed char> >::_M_initialize_buckets(unsigned long)' from file '/Users//MAMapKit.framework/MAMapKit(MAMapKit-arm64-master.o)' to global weak symbol 'sgi::__malloc_alloc_template<0>::__malloc_alloc_oom_handler' from file '/Users/*/MAMapKit.framework/MAMapKit(MAMapKit-arm64-master.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
这个问题产生的原因是MAMapKit-arm64-master.o支持的最低版本是11.1,而我项目支持的最低版本是8.0
解决办法有两个:
一、将项目支持的最低版本改为11.1
显然不现实。
二、在Build Settings -> other lingker Flags 中添加-w 。
以下是我的项目解决前后的警告数量。
参考:关于解决 was built for newer iOS version (10.0) than being linked (8.0)问题
说到解决这个问题就要说一下天朝最牛b的搜索引擎百度,我一个月之前就在解决这个问题,一直百度不到方案,后来新需求比较急就忽略了,今天想起来之后就google了一下,瞬间解决。
同样的搜索内容Kit-arm64-master.o)) was built for newer iOS version (11.1) than being linked (8.0)
搜索结果如下:看google一屏幕都是解决方案,我是不知道百度都在干些什么,光顾着打广告挣钱了?