gpt4 book ai didi

objective-c - 添加OpenKit时出现重复符号错误

转载 作者:行者123 更新时间:2023-12-02 10:42:46 24 4
gpt4 key购买 nike

我正在尝试使用OpenKit Framework将排行榜添加到我的游戏中。在他们的文档之后,我添加了所有必需的库+框架,但是发生了以下错误:

duplicate symbol _OBJC_IVAR_$_AFOAuth1Client._applicationLaunchNotificationObserver in:
/Users/Sa7bi/Library/Developer/Xcode/DerivedData/helloworld-erlcedkitaorqobgauzlzyvacnfi/Build/Intermediates/helloworld.build/Debug-iphoneos/helloworld.build/Objects-normal/armv7s/AFOAuth1Client.o
/Users/Sa7bi/Dropbox/Aliens Wings/HelloWorld/OpenKitSDK/libOpenKit.a(AFOAuth1Client.o)
duplicate symbol _OBJC_IVAR_$_AFOAuth1Client._key in:
/Users/Sa7bi/Library/Developer/Xcode/DerivedData/helloworld-erlcedkitaorqobgauzlzyvacnfi/Build/Intermediates/helloworld.build/Debug-iphoneos/helloworld.build/Objects-normal/armv7s/AFOAuth1Client.o
/Users/Sa7bi/Dropbox/Aliens Wings/HelloWorld/OpenKitSDK/libOpenKit.a(AFOAuth1Client.o)
duplicate symbol _OBJC_IVAR_$_AFOAuth1Client._secret in:
/Users/Sa7bi/Library/Developer/Xcode/DerivedData/helloworld-erlcedkitaorqobgauzlzyvacnfi/Build/Intermediates/helloworld.build/Debug-iphoneos/helloworld.build/Objects-normal/armv7s/AFOAuth1Client.o
/Users/Sa7bi/Dropbox/Aliens Wings/HelloWorld/OpenKitSDK/libOpenKit.a(AFOAuth1Client.o)
duplicate symbol _OBJC_IVAR_$_AFOAuth1Client._signatureMethod in:
/Users/Sa7bi/Library/Developer/Xcode/DerivedData/helloworld-erlcedkitaorqobgauzlzyvacnfi/Build/Intermediates/helloworld.build/Debug-iphoneos/helloworld.build/Objects-normal/armv7s/AFOAuth1Client.o
/Users/Sa7bi/Dropbox/Aliens Wings/HelloWorld/OpenKitSDK/libOpenKit.a(AFOAuth1Client.o)
duplicate symbol _OBJC_IVAR_$_AFOAuth1Client._realm in:
/Users/Sa7bi/Library/Developer/Xcode/DerivedData/helloworld-erlcedkitaorqobgauzlzyvacnfi/Build/Intermediates/helloworld.build/Debug-iphoneos/helloworld.build/Objects-normal/armv7s/AFOAuth1Client.o
/Users/Sa7bi/Dropbox/Aliens Wings/HelloWorld/OpenKitSDK/libOpenKit.a(AFOAuth1Client.o)
....
ld: 19 duplicate symbols for architecture armv7s

在此网站上搜索时,一些用户提出以下建议:
  • 多次编译同一文件==>检查了我的[Build Phases |编译源]什么都没有
  • 导入“.m”文件而不是“.h” ==>检查了我所有的导入,没有

  • 我真的不知道是什么原因造成的。
    更新:我忘了提到我的项目中包含Google Ads SDK。当我删除“-ObjC”链接器标志时,OpenKit可以正常工作,但Google不能。

    最佳答案

    经过数周的搜索,我找到了解决方案。不用在Google Ads中使用“-ObjC”链接器标志,而是“force_load”是理想的解决方案。
    根据@OpenKit的说法,“-ObjC”标志与OpenKit lib混为一谈:

    The problem is that the -ObjC flag loads all categories, and we removed some categories from the OpenKit SDK to make it work without using that flag.



    force_load :load only that framework without messing with anything else.[source]

    关于objective-c - 添加OpenKit时出现重复符号错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22589828/

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