在Unity導出的IOS項目中停止開發時,自定義的視圖中運用SceneKit時報錯:
ld: warning: arm64 function not 4-byte aligned: ltmp0 from /Users/hustlion/idc/20161217園博園/HolyEvilCapture/Libraries/libiPhone-lib.a(unWind_test_arm64.o)
ld: warning: arm64 function not 4-byte aligned: _unWind_tester from /Users/hustlion/idc/20161217園博園/HolyEvilCapture/Libraries/libiPhone-lib.a(unWind_test_arm64.o)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_SCNLight", referenced from:
objc-class-ref in playerInfoViewController.o
"_OBJC_CLASS_$_SCNCamera", referenced from:
objc-class-ref in playerInfoViewController.o
"_SCNLightTypeOmni", referenced from:
-[playerInfoViewController addScene] in playerInfoViewController.o
"_OBJC_CLASS_$_SCNNode", referenced from:
objc-class-ref in playerInfoViewController.o
"_OBJC_CLASS_$_SCNScene", referenced from:
objc-class-ref in playerInfoViewController.o
"_SCNLightTypeAmbient", referenced from:
-[playerInfoViewController addScene] in playerInfoViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
緣由剖析
筆者在獨自寫UI界面(沒有與Unity整合時),運用SceneKit只需求援用對應的頭文件。但是與Unity整合後,發現需求在Build Phases中引入SceneKit.framework才干正常編譯。能夠是Unity導進項目的某些編譯設定招致了要額定引入SceneKit.framework才干運用SceneKit。
處理方法在Build Phases中引入SceneKit.framework,如圖所示:
遇到Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SCNLight"
相似的錯誤時,可以先思索能否有相應的framework可以引入。
【iOS整合Unity項目參加SceneKit報錯Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SCNLight"】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!