我已經在網上檢查了試圖解決該問題,但到目前爲止沒有任何工作。xcode - 包含cocoapods庫時的庫鏈接問題
很少有人建議刪除../Xcode/DerivedData/
下的文件,但沒有做任何事情。我試着玩了Library Search Paths
和Other Linker Flags
鏈接標誌:
//:configuration = Debug OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaAsyncSocket" -framework -l"GHODictionary" -l"MDWamp" -l"MPMessagePack" -l"SocketRocket" -framework -l"icucore" -framework "Security"
//:configuration = Release OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaAsyncSocket" -framework -l"GHODictionary" -l"MDWamp" -l"MPMessagePack" -l"SocketRocket" -framework -l"icucore" -framework "Security"
//:completeSettings = some OTHER_LDFLAGS
我想包括到Xcode中MDWamp這一點。我做了pod init
,並在podfile中包含了MDWamp
。
Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Example' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Example
pod "MDWamp"
end
我一直在清理和重建希望它修復本身。 希望這將是一個簡單的包括,但一直沒有工作。
編輯:
錯誤:
ld: warning: directory not found for option '-L/Users/user/Library/Developer/Xcode/DerivedData/Example-fvftguwrkfoqgvaswdscaatwogtt/Build/Products/Debug-iphonesimulator/CocoaAsyncSocket'
ld: warning: directory not found for option '-L/Users/user/Library/Developer/Xcode/DerivedData/Example-fvftguwrkfoqgvaswdscaatwogtt/Build/Products/Debug-iphonesimulator/GHODictionary'
ld: warning: directory not found for option '-L/Users/user/Library/Developer/Xcode/DerivedData/Example-fvftguwrkfoqgvaswdscaatwogtt/Build/Products/Debug-iphonesimulator/MDWamp'
ld: warning: directory not found for option '-L/Users/user/Library/Developer/Xcode/DerivedData/Example-fvftguwrkfoqgvaswdscaatwogtt/Build/Products/Debug-iphonesimulator/MPMessagePack'
ld: warning: directory not found for option '-L/Users/user/Library/Developer/Xcode/DerivedData/Example-fvftguwrkfoqgvaswdscaatwogtt/Build/Products/Debug-iphonesimulator/SocketRocket'
ld: library not found for -lCocoaAsyncSocket
clang: error: linker command failed with exit code 1 (use -v to see invocation)
結果從pod install
:
Analyzing dependencies
Downloading dependencies
Using CocoaAsyncSocket (7.5.1)
Using GHODictionary (1.1.0)
Using MDWamp (2.2.4)
Using MPMessagePack (1.3.13)
Using SocketRocket (0.5.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 5 total pods installed.
的警告是通過使相應的目錄解決了,我不能確定什麼樣的負面會引起未來。唯一存在的問題是鏈接器錯誤。
當試圖使用此窗格獲取此錯誤:!]目標ObjectiveC-2(iOS 10.2)的平臺與不支持'ios'的'MPMessagePack(1.3.8)'不兼容。 –
@HarishGupta很奇怪。這個庫已經過測試,並且設想嚴格爲'Objective-C'工作。這個庫甚至在想要使用'WAMP'時提示。無論如何要解決這個問題嗎? – zyeek