0

I am learning code here - a video player on Mac OS X depends on MPlayerX: https://bitbucket.org/Tomasen/splayerx/src/ Have something confused with binary including in Xcode: https://bitbucket.org/Tomasen/splayerx/src/a97f03511dfc/binaries/x86_64 there is a binary called mplayer-mt(not .a file, it's exectuable) How is the binary used in Xcode? How to import it or how to config?

Here is my build fail info:

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

Undefined symbols for architecture x86_64: "_MPLog", referenced from: -[PlayerController playMedia:] in PlayerController.o -[PlayerController playebackStarted] in PlayerController.o "_OBJC_CLASS_$_CoreController", referenced from: objc-class-ref in PlayerController.o "_OBJC_CLASS_$_PlayList", referenced from: objc-class-ref in PlayerController.o "_OBJC_CLASS_$_StoreHandler", referenced from: objc-class-ref in OSDView.o "_OBJC_CLASS_$_ssclThread", referenced from: objc-class-ref in PlayerController.o "_kI386Key", referenced from: -[PlayerController setMultiThreadMode:] in PlayerController.o "_kKVOPropertyKeyPathAudioDelay", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathAudioInfo", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathAudioInfoID", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathCachingPercent", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathCurrentTime", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathLength", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSeekable", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSpeed", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSubDelay", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSubInfo", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathSubScale", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathVideoInfo", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kKVOPropertyKeyPathVideoInfoID", referenced from: -[PlayerController setupKVO] in PlayerController.o -[PlayerController dealloc] in PlayerController.o "_kMPCPlayStoppedByForceKey", referenced from: -[PlayerController playebackStopped:] in PlayerController.o "_kMPCPlayStoppedTimeKey", referenced from: -[PlayerController playebackStopped:] in PlayerController.o "_kMPCStringMPlayerX", referenced from: -[PlayerController init] in PlayerController.o "_kPMValDemuxFFMpeg", referenced from: -[PlayerController playMedia:] in PlayerController.o "_kUDKeyAC3PassThrough", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyAPNFuzzy", referenced from: +[PlayerController initialize] in PlayerController.o "_kUDKeyAutoPlayNext", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playebackStopped:] in PlayerController.o "_kUDKeyAutoResume", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyCacheSize", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyCachingLocal", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyDTSPassThrough", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyEnableMultiThread", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController init] in PlayerController.o "_kUDKeyFFMpegHandleStream", referenced from: -[PlayerController playMedia:] in PlayerController.o "_kUDKeyForceIndex", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyLetterBoxHeight", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyLetterBoxMode", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyLetterBoxModeAlt", referenced from: +[PlayerController initialize] in PlayerController.o "_kUDKeyMixToStereoMode", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyOSDAutoHideTime", referenced from: +[OSDView initialize] in OSDView.o -[OSDView initWithFrame:] in OSDView.o "_kUDKeyOSDFontSizeMax", referenced from: +[OSDView initialize] in OSDView.o -[OSDView setStringValue:type:updateTimer:] in OSDView.o "_kUDKeyOSDFontSizeMin", referenced from: +[OSDView initialize] in OSDView.o -[OSDView setStringValue:type:updateTimer:] in OSDView.o "_kUDKeyOSDFrontColor", referenced from: +[OSDView initialize] in OSDView.o -[OSDView initWithFrame:] in OSDView.o "_kUDKeyOverlapSub", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyPlayWhenOpened", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o -[PlayerController playebackStopped:] in PlayerController.o "_kUDKeyPrefer64bitMPlayer", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController shouldRun64bitMPlayer] in PlayerController.o "_kUDKeyPreferIPV6", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeyRtspOverHttp", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeySmartSubMatching", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o -[PlayerController playebackStarted] in PlayerController.o "_kUDKeySubFileNameRule", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o -[PlayerController findFirstMediaFileFromSubFile:] in PlayerController.o "_kUDKeySubFontBorderColor", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeySubFontColor", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kUDKeySubFontPath", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController init] in PlayerController.o "_kUDKeySubScale", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o -[PlayerController changeSubScaleBy:] in PlayerController.o -[PlayerController setSubScale:] in PlayerController.o "_kUDKeySubScaleStepValue", referenced from: +[PlayerController initialize] in PlayerController.o "_kUDKeyTextSubtitleCharsetConfidenceThresh", referenced from: -[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] in PlayerController.o "_kUDKeyTextSubtitleCharsetFallback", referenced from: -[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] in PlayerController.o "_kUDKeyTextSubtitleCharsetManual", referenced from: -[PlayerController subConverter:detectedFile:ofCharsetName:confidence:] in PlayerController.o "_kUDKeyThreadNum", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController setMultiThreadMode:] in PlayerController.o "_kUDKeyUseEmbeddedFonts", referenced from: +[PlayerController initialize] in PlayerController.o -[PlayerController playMedia:] in PlayerController.o "_kX86_64Key", referenced from: -[PlayerController setMultiThreadMode:] in PlayerController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Tsung Wu
  • 1,064
  • 9
  • 17

2 Answers2

0

Your linker has failed, and linkers do not have anything to do with files that are directly executable outside of XCode. At least as far as I know.

Instead have you tried to include the .dylib files from your library in your xcode build? Download them locally and then use the "Link Binary With Libraries" section of the "Build Phases" tab to add them to your current project, using the plus button.

If you haven't done this before, you have to click on your target in the left hand window to find either these items.

Merk
  • 1,441
  • 1
  • 15
  • 28
  • You are right, after I moved the mplayer-mt somewhere else, the SPlayerX is built success too. But I dunt see anything else about mplayer included. – Tsung Wu Sep 21 '12 at 05:41
  • I don't understand. What is not happening that should be happening? – Merk Sep 21 '12 at 05:51
  • Hmm, just confused why linker failed. No dylib about mplayer found in the source code – Tsung Wu Sep 21 '12 at 06:12
  • The names of the .dylib files are arbitrary. Also, .dylib files themselves will never be referenced in source code. The reason why a linker fails, generally, is because a promise has been broken. The promise is made in a header file when a declaration of an object is made--a description of its shape but not its details. The compiler doesn't care about the details because it treats these details as 'blanks'. The linker, however, is supposed to put all the pieces together, and if the promised item is not in any of the files provided, it will fail. – Merk Sep 21 '12 at 06:29
  • thanks for your patience, it is just error info of 'target not checked when file dragged to Xcode'......and I am still working on it.. – Tsung Wu Sep 21 '12 at 08:04
0

Found that the author of SPlayerX start the binary with arguments but not embed. Check it out here if you are interested: PlayerCore.m

Tsung Wu
  • 1,064
  • 9
  • 17