XCode10移除libstdc++的解決方案

最近在測試出包中,所以一直沒有機會將問題寫下來。

我們用的Unity版本很老。Unity4.7,打包的時候發現XCODE10無法打包出來,編譯過程中老是會出現頭文件缺失的情況。查了很久才發現,原來XCode10和之前版本刪了一個庫libstdc++,這就很好的解釋了爲什麼之前打包會出現各種各樣的頭文件缺失了。

我們後來用了XCode9.4 發現可以正常編譯。這更進一步證實了那個錯誤。

但是隨着測試機型越來越多,我們驚訝的發現,XCode9.4不支持目前所有的IOS設備的。尤其是蘋果今年新推的幾款產品,用了A12芯片,無法用老版本打包了。

所以添加libstdc++,就變成了燃眉之急。

以下的方法我親身測試過。所以想要分享給大家。

如果大家有老版本的XCode的話可以直接去複製。如果大家不想下載的話,那就直接到我的資源去下載。https://download.csdn.net/download/u011625767/11072049

至於如何去下載老版本的XCode的話,蘋果官網就可以下載了。

具體鏈接https://developer.apple.com/download/more 

想要下載哪個下載哪個吧。

然後我們提供的資源有5個文件夾,大家挨個複製。就可以

將文件1內容添加到該路徑中: (add the file 1 content into such path:)

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

將文件2內容添加到該路徑中: (add the file 2 content into such path:)

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

將文件3內容添加到該路徑中: (add the file 3 content into such path:)

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

將命名爲include的文件合併替換爲文件4內容: (merge such the file which named “include” with the file 4 content:)

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include

將命名爲include的文件合併替換爲文件5內容: : (merge such the file which named “include” with the file 5 content:)

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章