Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Fixed] Failed running D:\Unity\2019.3.15f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe

Discussion in 'Windows' started by WingsOfAltair, Jul 15, 2020.

  1. WingsOfAltair

    WingsOfAltair

    Joined:
    Dec 12, 2012
    Posts:
    12
    My project builds for iOS and Android using ILCPP with no problem. But it produces these errors for Windows 64-bit ILCPP builds. Help!

    EDIT: I have got to clarify that I tried downloading a newer Windows SDK but it did not work. Also, an earlier version of my project does build. However, this one does not even though it has no errors during playing in the editor, or either major mobile platforms..

    EDIT 2: Fixed!
    All I had to do was enter the Photon's plugin PhotonVoiceLibs folder, and make sure that each file is exported or imported according to its folder name. I.e. x86 gets to export to Windows x86 on Standalone and Editor ticked while Android gets ARM64 on Android ticked.

    Failed running D:\Unity\2019.3.15f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x64" --configuration="Release" --outputpath="D:\Unity\Projects\Invasion Zero\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="D:\Unity\Projects\Invasion Zero\Assets\..\Library/il2cpp_cache" --incremental-g-c-time-slice=3 --profiler-report --map-file-parser=D:/Unity/2019.3.15f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe --directory="D:/Unity/Projects/Invasion Zero/Temp/StagingArea/Data/Managed" --generatedcppdir="D:/Unity/Projects/Invasion Zero/Temp/StagingArea/Data/il2cppOutput"

    stdout:
    Building GameAssembly.dll with MsvcDesktopToolChain
    Msvc Install Version: 15.0
    Msvc Install SDK Directory: C:\Program Files (x86)\Windows Kits\10
    Msvc Linker Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\link.exe
    Msvc Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.exe

    Output directory: D:\Unity\Projects\Invasion Zero\Temp\StagingArea\Data\Native
    Cache directory: D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache
    ObjectFiles: 281 of which compiled: 281
    Time Compile: 20052 milliseconds mscorlib7.cpp
    Time Compile: 13136 milliseconds Assembly-CSharp10.cpp
    Time Compile: 11088 milliseconds System8.cpp
    Time Compile: 9826 milliseconds Assembly-CSharp8.cpp
    Time Compile: 9710 milliseconds Lump_libil2cpp_vm.cpp
    Time Compile: 9195 milliseconds Lump_libil2cpp_os.cpp
    Time Compile: 9109 milliseconds Assembly-CSharp7.cpp
    Time Compile: 8283 milliseconds Assembly-CSharp5.cpp
    Time Compile: 7131 milliseconds mscorlib5.cpp
    Time Compile: 6481 milliseconds Generics20.cpp
    Total compilation time: 92002 milliseconds.
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\link.exe /out:"D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.dll" /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /OPT:REF /OPT:ICF /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "kernel32.lib" "user32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "Shell32.lib" "Crypt32.lib" "psapi.lib" "version.lib" "MsWSock.lib" "ws2_32.lib" "Iphlpapi.lib" "Dbghelp.lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x64" /SUBSYSTEM:WINDOWS @"C:\Users\basha\AppData\Local\Temp\tmpDCA3.tmp"

    Creating library D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.lib and object D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.exp
    4C61AA2EEFF6DC7EB00DFA2CF6EF029D.obj : error LNK2019: unresolved external symbol opus_encoder_ctl referenced in function opus_encoder_ctl_get_ext
    4C61AA2EEFF6DC7EB00DFA2CF6EF029D.obj : error LNK2019: unresolved external symbol opus_decoder_ctl referenced in function opus_decoder_ctl_get_ext
    D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.dll : fatal error LNK1120: 2 unresolved externals

    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    at il2cpp.Program.Main(String[] args)
    stderr:

    Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\link.exe /out:"D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.dll" /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /OPT:REF /OPT:ICF /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "kernel32.lib" "user32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "Shell32.lib" "Crypt32.lib" "psapi.lib" "version.lib" "MsWSock.lib" "ws2_32.lib" "Iphlpapi.lib" "Dbghelp.lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x64" /SUBSYSTEM:WINDOWS @"C:\Users\basha\AppData\Local\Temp\tmpDCA3.tmp"

    Creating library D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.lib and object D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.exp
    4C61AA2EEFF6DC7EB00DFA2CF6EF029D.obj : error LNK2019: unresolved external symbol opus_encoder_ctl referenced in function opus_encoder_ctl_get_ext
    4C61AA2EEFF6DC7EB00DFA2CF6EF029D.obj : error LNK2019: unresolved external symbol opus_decoder_ctl referenced in function opus_decoder_ctl_get_ext
    D:\Unity\Projects\Invasion Zero\Library\il2cpp_cache\linkresult_06EB3BE74A620B2E0BB241E041C0763F\GameAssembly.dll : fatal error LNK1120: 2 unresolved externals

    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    at il2cpp.Program.Main(String[] args)

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1)
    UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean)
    UnityEditorInternal.IL2CPPBuilder:Run()
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
    DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs, HashSet`1)
    DesktopStandalonePostProcessor:postProcess(BuildPostProcessArgs)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    --------------------------------------------------------------------------------------------------------------------------------------------

    Exception: D:\Unity\2019.3.15f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!
    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEditorInternal.IL2CPPBuilder.Run () (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <a20a50bbfaff4193bf6ba6b262f9a71f>: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 <a20a50bbfaff4193bf6ba6b262f9a71f>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    --------------------------------------------------------------------------------------------------------------------------------------------

    Build completed with a result of 'Failed' in 678 seconds (677622 ms)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    --------------------------------------------------------------------------------------------------------------------------------------------

    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in <a20a50bbfaff4193bf6ba6b262f9a71f>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <a20a50bbfaff4193bf6ba6b262f9a71f>:0
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    --------------------------------------------------------------------------------------------------------------------------------------------
     
    Last edited: Jul 16, 2020
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,638
    Here's the key:

    Code (csharp):
    1. 4C61AA2EEFF6DC7EB00DFA2CF6EF029D.obj : error LNK2019: unresolved external symbol opus_encoder_ctl referenced in function opus_encoder_ctl_get_ext
    2. 4C61AA2EEFF6DC7EB00DFA2CF6EF029D.obj : error LNK2019: unresolved external symbol opus_decoder_ctl referenced in function opus_decoder_ctl_get_ext
    It cannot find functions named "opus_encoder_ctl" and "opus_decoder_ctl". You're calling into them using [DllImport("__Internal")], which means they must be present in the project at build time.
     
    WingsOfAltair likes this.
  3. WingsOfAltair

    WingsOfAltair

    Joined:
    Dec 12, 2012
    Posts:
    12
    Where exactly should I place them and where do I find them?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,638
    They get called in your project from opus_encoder_ctl_get_ext and opus_decoder_ctl_get_ext functions. I don't know where to find them, it's your code... placing C++ files in the project with the function definitions should solve this.
     
    WingsOfAltair likes this.
  5. WingsOfAltair

    WingsOfAltair

    Joined:
    Dec 12, 2012
    Posts:
    12
    Your former comment:

    as well as your last comment have both helped me fix the issue. Thank you very much.
    All I had to do was enter the Photon's plugin PhotonVoiceLibs folder, and make sure that each file is exported or imported according to its folder name. I.e. x86 gets to export to Windows x86 on Standalone and Editor ticked while Android gets ARM64 on Android ticked.
     
    Tautvydas-Zilys likes this.
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,638
    Glad you sorted it out!
     
unityunity