繁体   English   中英

xcode - 包含 cocoapods 库时的库链接问题

[英]xcode - Library linking issue when including cocoapods library

我已经在网上检查过试图解决这个问题,但到目前为止都没有奏效。

很少有人建议删除../Xcode/DerivedData/下的文件,但没有做任何事情。 我尝试使用Library Search PathsOther 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并将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.

通过创建相应的目录解决了警告,我不确定将来会造成什么负面影响。 唯一剩下的问题是链接器错误。

所以我真的只能在使用Cocoapods的 GUI 版本并从 GUI 安装它的意外情况下让它工作。

我有同样的问题。 我尝试了很多解决方案,但我发现这个工作正常。

项目 -> 构建设置 -> (SEARCH -> Library_search_path)

打开它并删除所有引号

“$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)”到 $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)

对于所有三个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM