gpt4 book ai didi

ios - 在我的项目中通过 pod 安装 MobileVLCKit 时显示链接器错误

转载 作者:行者123 更新时间:2023-11-28 15:11:29 28 4
gpt4 key购买 nike

在我通过 pod 安装 MobileVLCKit 的 swift 项目中出现链接器错误。

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_VLCMediaPlayer", referenced from:
objc-class-ref in StreamingController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我做了以下步骤

  1. 解决 Vlckit pod install 后构建项目的错误在构建阶段 -> 链接二进制文件 -> libstdc++.6.tbd

  2. 解决上一步后的 apple-linker 错误BuildSettings ->'EnableBitcode = No'

  3. 在 Bridging-Header 文件中,执行 #import <MobileVLCKit/MobileVLCKit.h>

在“BuildSettings -> other_linker_flags”中,此 MobileVLCKit 框架也未显示,但我可以在“Pods”文件夹中看到“MobileVLCKit”文件夹


编辑

我能够通过执行以下步骤消除此错误并找到“MobileVLCKit”:

  1. 在 Build_Settings -> Other_Linker_Flags 中,添加:-framework "MobileVLCKit"
  2. 在 Build_Settings -> Other_Linker_Flags 中,添加:-l"bz2"
  3. 在 Build_Settings -> Other_Linker_Flags 中,添加:-l"iconv"

但随后这些修复从 AVSLibrary 框架中使用的其他框架“libavsobjc.stripped.a”生成了其他链接器错误,该框架在应用程序中用于其他目的。

我希望 Vlc 和 AVSLibrary 应该共存。有什么想法吗?

最佳答案

我遇到了类似的问题,为了解决这个问题付出了很多努力。

  1. 创建一个虚拟 Xcode 项目,使用 cocoa pods 下载 MobileVLCkit。
  2. 将虚拟项目中下载的“MobileVLCKit.framework”文件复制到您的项目根文件夹中。
  3. 转到项目的目标build设置并将以下行添加到“标题搜索路径”(也添加引号)“$(PROJECT_DIR)/MobileVLCKit.framework/Headers”“$(BUILT_PRODUCTS_DIR)”
  4. 在您项目的目标build设置中,将以下行添加到您的框架搜索路径中(也添加引号)“$(SRCROOT)/MobileVLCKit.framework”“$(PROJECT_DIR)”
  5. 在其他链接器标志中添加以下行-l“bz2”-l“iconv”-框架“MobileVLCKit”
  6. 在常规 > 链接框架和库中单击 + 图标添加以下库libstdc++.6.tbd
  7. 最重要的是通过包含以下行来添加对 Bridging-Header.h 的引用#import "MobileVLCKit/MobileVLCKit.h"
  8. 通过键入 VLCMediaPlayerDelegate 进行测试,看看是否自动完成。如果是这样,请将他们指向此处以帮助其他人,否则请原路返回以查看您错过了什么。

希望对您有所帮助。我能够通过下面给出的链接解决这个问题。来源:https://forum.videolan.org/viewtopic.php?f=32&t=137065

关于ios - 在我的项目中通过 pod 安装 MobileVLCKit 时显示链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47567315/

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