ios Undefined symbols for architecture x86_64: "XXX", "_OBJC_CLASS_$_", referenced fr
iOS出現錯誤。
Undefined symbols for architecture x86_64:
"_IJKMPMediaPlaybackIsPreparedToPlayDidChangeNotification", referenced from:
-[IJKMoviePlayerSvodViewController installMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerSvodViewController removeMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerPplayViewController installMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerPplayViewController removeMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerUplayViewController installMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
-[IJKMoviePlayerUplayViewController removeMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
"_IJKMPMoviePlayerLoadStateDidChangeNotification", referenced from:
-[IJKMoviePlayerSvodViewController installMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerSvodViewController removeMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerPplayViewController installMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerPplayViewController removeMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerUplayViewController installMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
-[IJKMoviePlayerUplayViewController removeMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
"_IJKMPMoviePlayerPlaybackDidFinishNotification", referenced from:
-[IJKMoviePlayerSvodViewController installMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerSvodViewController removeMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerPplayViewController installMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerPplayViewController removeMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerUplayViewController installMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
-[IJKMoviePlayerUplayViewController removeMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
"_IJKMPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:
-[IJKMoviePlayerSvodViewController moviePlayBackDidFinish:] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerPplayViewController moviePlayBackDidFinish:] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerUplayViewController moviePlayBackDidFinish:] in IJKMoviePlayerUplayViewController.o
"_IJKMPMoviePlayerPlaybackStateDidChangeNotification", referenced from:
-[IJKMoviePlayerSvodViewController installMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerSvodViewController removeMovieNotificationObservers] in IJKMoviePlayerSvodViewController.o
-[IJKMoviePlayerPplayViewController installMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerPplayViewController removeMovieNotificationObservers] in IJKMoviePlayerPplayViewController.o
-[IJKMoviePlayerUplayViewController installMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
-[IJKMoviePlayerUplayViewController removeMovieNotificationObservers] in IJKMoviePlayerUplayViewController.o
"_OBJC_CLASS_$_IJKFFMoviePlayerController", referenced from:
objc-class-ref in IJKMoviePlayerSvodViewController.o
objc-class-ref in IJKMoviePlayerPplayViewController.o
objc-class-ref in IJKMoviePlayerUplayViewController.o
"_OBJC_CLASS_$_IJKFFOptions", referenced from:
objc-class-ref in IJKMoviePlayerSvodViewController.o
objc-class-ref in IJKMoviePlayerPplayViewController.o
objc-class-ref in IJKMoviePlayerUplayViewController.o
"_OBJC_CLASS_$_LiveVideoCoreSDK", referenced from:
objc-class-ref in LiveShowViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決方法
這個錯誤的發生原因一般是“XXX”這個檔案(類庫)雖然引入了工程中,但是由於種種原因(常見於多人開發,svn同步不規範)導致“XXX”並未被新增到project.pbxproj這個檔案中。
解決方法是點選工程,
1.看這個是不是第三方庫中的類
在 target -> Build Phases -> Link Binary With Libraries 中新增,類所在的第三方庫。
2如果是自己專案中的類
在targets介面中找到Build Phases,根據提示資訊“XXX”來判斷缺少什麼檔案,一般如果缺少自定義的檔案,XXX會是缺少的類名,那麼就在Complie Sources中加入該檔案。如果缺少類庫,
則在Link Binary With Libraries中加入該類庫。
如果這樣還不行,估計是這個第三方庫不支援 模擬器,或,真機的架構,之類的問題,反正;就是link方面沒有這個類的原因