LoginSignup
15
5

More than 5 years have passed since last update.

[Unity]StandaloneWindowsでIL2CPPを使うために必要だったモノ

Last updated at Posted at 2018-05-04

[Unity]StandaloneWindowsでIL2CPPを使うために必要だったモノ

環境類

  • Windows10(64bit)
  • Unity 2018.1.0f2
    • Player Settings
      • Scripting Runtime Version:.NET 4.x Equivalent
      • Scripting Backend:IL2CPP
      • Api Compatibility Level:.NET 4.x
    • Build Settings
      • Platform:PC, Mac & Linux Standalone
      • Target Platform:Windows
      • Architecture:x86_64
  • Visual Studio 2017 community

準備せずに起きる事

  • 以下のようなログと共にビルドが失敗する。
il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
        Visual Studio 2010 with C++ compilers and Windows 7 SDK (it cannot build C++ code because it is not installed)
        Visual Studio 2010 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir" in the registry
        Windows 7 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder" in the registry

        Visual Studio 2013 with C++ compilers and Windows 8.1 SDK (it cannot build C++ code because it is not installed)
        Visual Studio 2013 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\12.0_Config\InstallDir" in the registry
        Windows 8.1 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1\InstallationFolder" in the registry

        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because Windows SDK is not installed)
        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry

        Visual Studio 2017 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
        Visual Studio 2017 installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry

対応

  • AndroidのIL2CPPでもNDKが必要だったようにWindows用のツールなどを追加する。
  • Visual Studio 2017 の メニューから ファイル/新規作成/プロジェクト 開いたダイアログからインストーラを開ける。 VSInstaller.gif
  • 関連ツールの追加を行う。(「C++によるデスクトップ開発」を追加すれば済む想定。ビルドするだけならオプションはおそらくもっと減らせると思います。) Workload.gif

これでひとまずビルドは通りました。
やはり高速化とか見込めるんでしょうかね?いろいろ触ってみようと思います。

15
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
5