gpt4 book ai didi

ios - 将OpenTok框架添加到我的项目中

转载 作者:行者123 更新时间:2023-12-01 16:28:11 26 4
gpt4 key购买 nike

所以我试图将OpenTok框架添加到我的代码中。我要从https://tokbox.com/developer/sdks/ios/下载IOS SDK,然后将opentok.framwork文件拖到我的框架列表中。当我构建代码时,它会因以下错误而失败:

Ld /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral normal arm64
cd /Users/hussein/Projects/ios-client
export IPHONEOS_DEPLOYMENT_TARGET=5.1.1
export PATH="/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Products/Debug-iphoneos -L/opt/vagrant/embedded/lib -F/Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/hussein/Projects/ios-client -filelist /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral.LinkFileList -miphoneos-version-min=5.1.1 -dead_strip -force_load -ObjC -mthumb -fobjc-arc -lsqlite3.0 -fobjc-arc -fobjc-link-runtime -framework GLKit -framework VideoToolbox -framework OpenTok -liconv -lstdc++.6.0.9 -lsqlite3 -framework LocalAuthentication /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Products/Debug-iphoneos/libCorePlot-CocoaTouch.a -framework MobileCoreServices -framework CoreText -weak_framework AdSupport -framework CoreAudio -weak_framework Social -framework QuartzCore -framework CoreGraphics -weak_framework Accounts -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework CFNetwork -framework CoreVideo -framework ImageIO -framework Foundation -framework MessageUI -framework OpenGLES -framework Twitter -framework AVFoundation -framework CoreMedia -framework CoreData -framework CoreFoundation -framework MapKit -framework CoreLocation -framework CoreTelephony -framework Security -framework SystemConfiguration -framework UIKit -Xlinker -dependency_info -Xlinker /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral_dependency_info.dat -o /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral

ld: file not found: -ObjC
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

好的,问题有点复杂:
当您将库拖到项目中时,您弄乱了链接器的标志(可以在Build Phase-> Other Linker Flags中看到它们),现在当cocoaPods成功添加OpenTok时(我尝试过,并且没有错误)仍然有标志(带有错误)。
现在是复杂的部分:真的很难知道哪个标志会引起问题。

(即使您删除了-Objc标志,该问题也可能来自其他标志,因为:
你得到一些继承,
您的项目可能需要此标志,
修改它们会导致其他错误
等)
,并且无法在xCode中“重置”您的标志。

因此最好的解决方案是:创建一个新项目,并用cocoapods OpenTok添加

platform :ios, '8.0'
use_frameworks!

target 'app' do
pod 'OpenTok', '~> 2.6'
end

target 'appTests' do
pod 'OpenTok', '~> 2.6'
end

target 'appUITests' do
pod 'OpenTok', '~> 2.6'
end

和我的过渡进口:
#import "OpenTok/OpenTok.h"

查看默认设置和cocoapod在新项目中是否仍然存在错误,如果没有,请在新项目中拖动之前的项目文件

关于ios - 将OpenTok框架添加到我的项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34024780/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com