Unable to build an Oculus (Android) platform with Scripting Backend set to IL2CPP. ARM64 architecture is selected in settings. Getting the following error in output:
Exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from C:\Sources\mycoolgame\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput\glmgr.cpp:7:
In file included from C:\Sources\mycoolgame\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput/glmgr.h:15:
C:\Sources\mycoolgame\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput/glmdisplay.h:13:10: fatal error: ‘OpenGL/OpenGL.h’ file not found
#include <OpenGL/OpenGL.h>
^~~~~~~~~~~~~~~~~
1 error generated.
Invocation was: Executable: “C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++”
Arguments: -DNET_4_0 -DUNITY_AOT -DIL2CPP_MONO_DEBUGGER_DISABLED -DGC_NOT_DLL -DRUNTIME_IL2CPP -DIL2CPP_ENABLE_WRITE_BARRIERS=1 -DIL2CPP_INCREMENTAL_TIME_SLICE=3 -DBASELIB_INLINE_NAMESPACE=il2cpp_baselib -DLINUX -DANDROID -DPLATFORM_ANDROID -D__linux__ -D__STDC_FORMAT_MACROS -DTARGET_ARM64 -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\libil2cpp\include" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\external\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\external\xxHash" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\external\baselib\Include" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\external\baselib\Platforms\Android\Include" -I"C:\Program Files\Unity\Hub\Editor\2021.1.2f1\Editor\Data\il2cpp\libil2cpp\pch" -I"C:\Sources\mycoolgame\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput" -I"." -c -g -DNDEBUG -fexceptions -fno-limit-debug-info -fdata-sections -ffunction-sections -Wa,–noexecstack -fno-rtti -std=c++11 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -fno-addrsig -fPIC -Os -stdlib=libc++ -target aarch64-linux-android21 -D__ANDROID_API__=21 -march=armv8-a -Wno-unused-value “C:\Sources\mycoolgame\Library\Il2cppBuildCache\Android\arm64-v8a\il2cppOutput\glmgr.cpp” -o “C:/Sources/mycoolgame/Library/il2cpp_android_arm64-v8a/il2cpp_cache/E675AF931E38E1C4697630B09DDA77C9.o”
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector) at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics) at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection
1 matchedAssemblyMethodSourceFiles)
at il2cpp.Program.DoRun(String[ ] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <4f969f18b6984883abf0f762caf9325d>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <4f969f18b6984883abf0f762caf9325d>:0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List
1[T] arguments, System.Action1[T] setupStartInfo) (at <4f969f18b6984883abf0f762caf9325d>:0) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <4f969f18b6984883abf0f762caf9325d>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <4f969f18b6984883abf0f762caf9325d>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action
1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <4f969f18b6984883abf0f762caf9325d>:0)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <4f969f18b6984883abf0f762caf9325d>:0)
UnityEditor.BuildPipeline:BuildPlayer(String[ ], String, BuildTarget, BuildOptions)