0

我在这里学习代码 - Mac OS X 上的视频播放器依赖于 MPlayerX: https ://bitbucket.org/Tomasen/splayerx/src/ 与 Xcode 中的二进制文件混淆: https ://bitbucket.org/Tomasen/ splayerx/src/a97f03511dfc/binaries/x86_64 有一个名为 mplayer-mt 的二进制文件(不是 .a 文件,它是可执行文件) Xcode 中如何使用二进制文件?如何导入或如何配置?

这是我的构建失败信息:

ld /Users/tsung/Library/Developer/Xcode/DerivedData/loss-fqhksenkliuhradvuyhbrddeakha/Build/Products/Debug/loss.app/Contents/MacOS/loss normal x86_64 cd /Users/tsung/works/mac/loss setenv MACOSX_DEPLOYMENT_TARGET 10.8 / Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8 .sdk -L/Users/tsung/Library/Developer/Xcode/DerivedData/loss-fqhksenkliuhradvuyhbrddeakha/Build/Products/Debug -L/Users/tsung/works/mac/loss/binaries/x86_64/lib -F/Users/tsung /Library/Developer/Xcode/DerivedData/loss-fqhksenkliuhradvuyhbrddeakha/Build/Products/Debug-filelist /Users/tsung/Library/Developer/Xcode/DerivedData/loss-fqhksenkliuhradvuyhbrddeakha/Build/Intermediates/loss.build/Debug/loss。build/Objects-normal/x86_64/loss.LinkFileList -mmacosx-version-min=10.8 -fobjc-link-runtime -framework Cocoa -o /Users/tsung/Library/Developer/Xcode/DerivedData/loss-fqhksenkliuhradvuyhbrddeakha/Build/Products /Debug/loss.app/Contents/MacOS/loss

架构 x86_64 的未定义符号:“_MPLog”,引用自:PlayerController.o 中的 -[PlayerController playMedia:] -PlayerController.o 中的[PlayerController playebackStarted] “_OBJC_CLASS_$_CoreController”,引用自:PlayerController.o 中的 objc-class-ref “_OBJC_CLASS_$_PlayList”,引用自:PlayerController.o 中的objc-class-ref “_OBJC_CLASS_$_StoreHandler”,引用自:OSDView.o 中的objc-class-ref “_OBJC_CLASS_$_ssclThread”,引用自:objc-class-ref在 PlayerController.o "_kI386Key" 中,引用自:-[PlayerController setMultiThreadMode:] 在 PlayerController.o "_kKVOPropertyKeyPathAudioDelay" 中,引用自:-[PlayerController setupKVO] 在 PlayerController。o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathAudioInfo",引用自:-[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathAudioInfoID",引用自:-[PlayerController setupKVO] in PlayerController。 o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathCachingPercent",引用自:-[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathCurrentTime",引用自:-[PlayerController setupKVO] in PlayerController。 o -[PlayerController dealloc] 在 PlayerController.o "_kKVOPropertyKeyPathLength" 中,引用自:-[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSeekable",引用自: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSpeed",引用自: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSubDelay",引用自: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSubInfo",引用自: -[PlayerController setupKVO] 在 PlayerController.o -[PlayerController dealloc] 在 PlayerController.o "_kKVOPropertyKeyPathSubScale",引用自:-[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathVideoInfo",引用自:-[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o" _kKVOPropertyKeyPathVideoInfoID",引用自:-[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kMPCPlayStoppedByForceKey",引用自:-[PlayerController playebackStopped:] in PlayerController.o "_kMPCPlayStoppedTimeKey",引用自:-[ PlayerController playebackStopped:] 在 PlayerController.o "_kMPCStringMPlayerX" 中,引用自:-[PlayerController init] in PlayerController.o "_kPMValDemuxFFMpeg",引用自:-[PlayerController playMedia:] in PlayerController.o "_kUDKeyAC3PassThrough",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController .o "_kUDKeyAPNFuzzy",引用自:+[PlayerController initialize] in PlayerController.o "_kUDKeyAutoPlayNext",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playebackStopped:] in PlayerController.o "_kUDKeyAutoResume",引用自: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyCacheSize",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyCachingLocal",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyDTSPassThrough ",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyEnableMultiThread",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController init] in PlayerController.o " _kUDKeyFFMpegHandleStream",引用自:-[PlayerController playMedia:] in PlayerController.o "_kUDKeyForceIndex",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyLetterBoxHeight",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyLetterBoxMode",引用来自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyLetterBoxModeAlt",引用自:+[PlayerController initialize] in PlayerController.o "_kUDKeyMixToStereoMode",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyOSDAutoHideTime",引用自:+[OSDView initialize] in OSDView.o -[OSDView initWithFrame:] in OSDView.o "_kUDKeyOSDFontSizeMax",引用自:+[OSDView initialize] in OSDView.o -[OSDView setStringValue:type:updateTimer:] in OSDView.o " _kUDKeyOSDFontSizeMin",引用自:+[OSDView initialize] in OSDView.o -[OSDView setStringValue:type:updateTimer:] in OSDView.o "_kUDKeyOSDFrontColor",引用自:+[OSDView initialize] in OSDView.o -[OSDView initWithFrame: ] 在 OSDView.o "_kUDKeyOverlapSub" 中,引用自:+[PlayerController initialize] 在 PlayerController.o -[PlayerController playMedia:] 在 PlayerController.o "_kUDKeyPlayWhenOpened",引用自:+[PlayerController initialize] 在 PlayerController。o -[PlayerController playMedia:] in PlayerController.o -[PlayerController playebackStopped:] in PlayerController.o "_kUDKeyPrefer64bitMPlayer",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController shouldRun64bitMPlayer] in PlayerController.o "_kUDKeyPreferIPV6",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyRtspOverHttp",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeySmartSubMatching ",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController。o -[PlayerController playebackStarted] in PlayerController.o "_kUDKeySubFileNameRule",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o -[PlayerController findFirstMediaFileFromSubFile:] in PlayerController.o "_kUDKeySubFontBorderColor",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeySubFontColor",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeySubFontPath ",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController init] in PlayerController。o "_kUDKeySubScale",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o -[PlayerController changeSubScaleBy:] in PlayerController.o -[PlayerController setSubScale:] in PlayerController.o "_kUDKeySubScaleStepValue" ,引用自:+[PlayerController initialize] in PlayerController.o "_kUDKeyTextSubtitleCharsetConfidenceThresh",引用自:-[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] in PlayerController.o "_kUDKeyTextSubtitleCharsetFallback",引用自:-[PlayerController subConverter:detectedFile: ofCharsetName:confidence:] 在 PlayerController.o "_kUDKeyTextSubtitleCharsetManual" 中,引用自:-[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] in PlayerController.o "_kUDKeyThreadNum",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController setMultiThreadMode:] in PlayerController.o "_kUDKeyUseEmbeddedFonts",引用自:+ PlayerController.o 中的 [PlayerController 初始化] -PlayerController.o 中的 [PlayerController playMedia:] "_kX86_64Key",引用自:PlayerController.o 中的 -[PlayerController setMultiThreadMode:] ld:未找到架构 x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)+[PlayerController initialize] in PlayerController.o -[PlayerController setMultiThreadMode:] in PlayerController.o "_kUDKeyUseEmbeddedFonts",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kX86_64Key",引用来自:-[PlayerController setMultiThreadMode:] in PlayerController.o ld:未找到体系结构 x86_64 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)+[PlayerController initialize] in PlayerController.o -[PlayerController setMultiThreadMode:] in PlayerController.o "_kUDKeyUseEmbeddedFonts",引用自:+[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kX86_64Key",引用来自:-[PlayerController setMultiThreadMode:] in PlayerController.o ld:未找到体系结构 x86_64 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)o “_kX86_64Key”,引用自:-[PlayerController setMultiThreadMode:] in PlayerController.o ld:未找到架构 x86_64 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)o “_kX86_64Key”,引用自:-[PlayerController setMultiThreadMode:] in PlayerController.o ld:未找到架构 x86_64 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

4

2 回答 2

0

您的链接器已失败,并且链接器与可在 XCode 之外直接执行的文件没有任何关系。至少据我所知。

相反,您是否尝试将库中的 .dylib 文件包含在您的 xcode 构建中?在本地下载它们,然后使用“Build Phases”选项卡的“Link Binary With Libraries”部分,使用加号按钮将它们添加到您当前的项目中。

如果您以前没有这样做过,则必须单击左侧窗口中的目标以找到这些项目。

于 2012-09-21T05:29:49.897 回答
0

发现 SPlayerX 的作者用参数启动二进制文件,但没有嵌入。如果您有兴趣,请在此处查看:PlayerCore.m

于 2012-09-25T06:44:49.160 回答