你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iOS整合Unity項目參加SceneKit報錯Undefined symbols for architecture arm64: _OBJC_CLASS_$_SCNLight

iOS整合Unity項目參加SceneKit報錯Undefined symbols for architecture arm64: _OBJC_CLASS_$_SCNLight

編輯:IOS開發綜合

問題描繪

在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,如圖所示:
IOS整合Unity項目加入SceneKit報錯Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SCNLight"

小結

遇到Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SCNLight"相似的錯誤時,可以先思索能否有相應的framework可以引入。

參考 IOS編譯報錯:objc-class-ref in AppDelegate.o之處理方案 Xcode7 iOS 中的 armv7,armv7s,arm64,i386,x86_64 都是什麼 No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=armv7 armv7s)

【iOS整合Unity項目參加SceneKit報錯Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SCNLight"】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved