簡體   English   中英

無法使用boost構建iOS項目:錯誤:鏈接器命令失敗,退出代碼為1(使用-v查看調用)

[英]Can't build iOS project with boost: error: linker command failed with exit code 1 (use -v to see invocation)

我通過brew包管理器將Boost添加到我的iOS項目中:

brew install boost

然后將標題路徑添加到項目設置:

/usr/local/**

現在項目沒有構建錯誤:

ld: file not found: ~/Library/Developer/Xcode/DerivedData/ios-hgivqqzmkrkxlvdazbhavxnxtxod/Build/Intermediates/ios.build/Debug-iphonesimulator/ios.build/Objects-normal/x86_64/TLRPCmessages_searchGifs.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

DerivedData/.../x86_64文件夾不包含任何*.o文件(僅限.d.dia.dat ),為什么它只涉及一個?


此外,我嘗試將標頭路徑更改為非遞歸: /usr/local/Cellar/boost/1.60.0_1/include ,並且構建錯誤變為此問題

但是我無法理解答案 - #include <cstddef>已經存在於boost中,編譯器是Apple LLVM:

錯誤

我該如何修復這個錯誤?

我手動解決了我的問題,但不記得怎么做。 無論如何,我的解決方案很糟糕,因為應用程序大小超過100 MB!

CocoaPods幫助了我, boost pod已經存在。

只需向Podfile添加行:

pod 'boost'

並在項目目錄中運行pod install 這個pod項目的構建沒有錯誤,應用程序的大小也不是很大。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM