xcode - 包含cocoapods库时的库链接问题
我已经在网上检查了试图解决该问题,但到目前为止没有任何工作。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.
的警告是通过使相应的目录解决了,我不能确定什么样的负面会引起未来。唯一存在的问题是链接器错误。
所以我真的只能使用GUI版本Cocoapods
来处理意外,并从GUI安装。
当试图使用此窗格获取此错误:!]目标ObjectiveC-2(iOS 10.2)的平台与不支持'ios'的'MPMessagePack(1.3.8)'不兼容。 –
@HarishGupta很奇怪。这个库已经过测试,并且设想严格为'Objective-C'工作。这个库甚至在想要使用'WAMP'时提示。无论如何要解决这个问题吗? – zyeek