我在这里学习代码 - 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",引自: PlayerController.o中的objc-class-ref " _kI386Key",引自: - PlayerController.o中的[PlayerController setMultiThreadMode:] " _kKVOPropertyKeyPathAudioDelay",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathAudioInfo",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathAudioInfoID",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathCachingPercent",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathCurrentTime",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathLength",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathSeekable",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathSpeed",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathSubDelay",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathSubInfo",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathSubScale",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathVideoInfo",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kKVOPropertyKeyPathVideoInfoID",引自: - PlayerController.o中的[PlayerController setupKVO] - PlayerController.o中的[PlayerController dealloc] " _kMPCPlayStoppedByForceKey",引自: - PlayerController.o中的[PlayerController playebackStopped:] " _kMPCPlayStoppedTimeKey",引自: - PlayerController.o中的[PlayerController playebackStopped:] " _kMPCStringMPlayerX",引自: - PlayerController.o中的[PlayerController init] " _kPMValDemuxFFMpeg",引自: - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyAC3PassThrough",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyAPNFuzzy",引自: 在PlayerController.o中+ [PlayerController初始化] " _kUDKeyAutoPlayNext",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playebackStopped:] " _kUDKeyAutoResume",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyCacheSize",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyCachingLocal",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyDTSPassThrough",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyEnableMultiThread",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController init] " _kUDKeyFFMpegHandleStream",引自: - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyForceIndex",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyLetterBoxHeight",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyLetterBoxMode",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyLetterBoxModeAlt",引自: 在PlayerController.o中+ [PlayerController初始化] " _kUDKeyMixToStereoMode",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyOSDAutoHideTime",引自: 在OSDView.o中选择[OSDView初始化] - OSDView.o中的[OSDView initWithFrame:] " _kUDKeyOSDFontSizeMax",引自: 在OSDView.o中选择[OSDView初始化] - OSDView.o中的[OSDView setStringValue:type:updateTimer:] " _kUDKeyOSDFontSizeMin",引自: 在OSDView.o中选择[OSDView初始化] - OSDView.o中的[OSDView setStringValue:type:updateTimer:] " _kUDKeyOSDFrontColor",引自: 在OSDView.o中选择[OSDView初始化] - OSDView.o中的[OSDView initWithFrame:] " _kUDKeyOverlapSub",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyPlayWhenOpened",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] - PlayerController.o中的[PlayerController playebackStopped:] " _kUDKeyPrefer64bitMPlayer",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController shouldRun64bitMPlayer] " _kUDKeyPreferIPV6",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeyRtspOverHttp",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeySmartSubMatching",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] - PlayerController.o中的[PlayerController playebackStarted] " _kUDKeySubFileNameRule",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] - PlayerController.o中的[PlayerController findFirstMediaFileFromSubFile:] " _kUDKeySubFontBorderColor",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeySubFontColor",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kUDKeySubFontPath",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController init] " _kUDKeySubScale",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] - PlayerController.o中的[PlayerController changeSubScaleBy:] - PlayerController.o中的[PlayerController setSubScale:] " _kUDKeySubScaleStepValue",引自: 在PlayerController.o中+ [PlayerController初始化] " _kUDKeyTextSubtitleCharsetConfidenceThresh",引自: - PlayerController.o中的[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] " _kUDKeyTextSubtitleCharsetFallback",引自: - PlayerController.o中的[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] " _kUDKeyTextSubtitleCharsetManual",引自: - PlayerController.o中的[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] " _kUDKeyThreadNum",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController setMultiThreadMode:] " _kUDKeyUseEmbeddedFonts",引自: 在PlayerController.o中+ [PlayerController初始化] - PlayerController.o中的[PlayerController playMedia:] " _kX86_64Key",引自: - PlayerController.o中的[PlayerController setMultiThreadMode:] ld:找不到架构x86_64的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
答案 0 :(得分:0)
您的链接器已失败,并且链接器与可直接在XCode之外执行的文件无关。至少据我所知。
您是否尝试在xcode构建中包含库中的.dylib文件?在本地下载它们,然后使用“Build Phases”选项卡的“Link Binary With Libraries”部分,使用加号按钮将它们添加到当前项目中。
如果您之前没有这样做,则必须在左侧窗口中单击目标以查找这些项目。
答案 1 :(得分:0)
发现SPlayerX的作者用参数启动二进制文件但没有嵌入。 如果您有兴趣,请在此处查看:PlayerCore.m