Build Error fatal error LNK1136: invalid or corrupt file

I upgraded to 2020.3.6f1, deleted the Library folder, am on a windows pc building for standalone windows, it has been building fine until now. But now I am getting errors, mainly the one in the title Fatal error LNK1136. The error doesn’t seem to help me and I haven’t been able to find a solution in the forum. I’ve been tweaking the Steamworks.net plugin and I have added .ogg files to my project. I have updated visual studio and upgraded to the new unity version and have turn off and on the editor numerous time but I can’t seem to find a solution to this. Here is the log message from console. Any help is appreciated.

Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\link.exe /out:“F:\SearchForSurf9.2\Library\il2cpp_cache\linkresult_1CA19B2C00FD20C51A498B18E64EA1F8\GameAssembly.dll” /ignore:4206 /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” “F:\2020.3.6f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp\baselib.dll.lib” /LIBPATH:“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\lib\x64” /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” /SUBSYSTEM:WINDOWS @“C:\Users\cuttinged\AppData\Local\Temp\tmp7D95.tmp”

E5852531A590FCA82F5C914439A24979.obj : fatal error LNK1136: invalid or corrupt file

at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet1 objectFiles, CppToolChainContext toolChainContext) at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics) at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection1 matchedAssemblyMethodSourceFiles)
at il2cpp.Program.DoRun(String[ ] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)

Update: Builds in mono. Builds with an empty project.

Also getting this. On the same Unity version.

I found out that this was the file path C:\Users\cuttinged\AppData\Local\Temp\tmp7D95.tmp - to the file - E5852531A590FCA82F5C914439A24979.obj from the console error message (posted above). When I went there, the file size was 0k and I deleted it, and I also found another file there that was 0k, when I deleted them I was able to build a IL2CPP build. I don’t know if that will help fix it for you, but that’s what worked for me.

1 Like

Good morning y’all

Thread’s getting old, but the same issue happened to me when trying to make a build and running out of storage space.
I was able to fix it by deleting the “il2cpp_cache” and “Il2cppBuildCache” directories inside the project’s Library folder

I hope this will help humans in the future. Happy deving!

2 Likes

An error from yesterday , i tried everything you suggest but no luck

Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /out:“D:\NewShip\ship-simulator-realistic\Library\il2cpp_cache\linkresult_4735566C2B42552FDE3651908B7DF282\GameAssembly.dll” /ignore:4206 /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” “C:\Program Files\Unity\Hub\Editor\2020.3.30f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp\baselib.dll.lib” /LIBPATH:“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\lib\x64” /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” /SUBSYSTEM:WINDOWS @“C:\Users\ships\AppData\Local\Temp\tmpB6F9.tmp”

11D6A022F55B910870D4A6767364587E.obj : fatal error LNK1136: invalid or corrupt file

at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet1 objectFiles, CppToolChainContext toolChainContext) at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics) at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection1 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 <68089899e4c84456bfc1de3436accf4a>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <68089899e4c84456bfc1de3436accf4a>:0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1[T] arguments, System.Action1[T] setupStartInfo) (at <68089899e4c84456bfc1de3436accf4a>:0) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <68089899e4c84456bfc1de3436accf4a>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <68089899e4c84456bfc1de3436accf4a>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <68089899e4c84456bfc1de3436accf4a>:0)
DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List1[T] cppPlugins) (at <68089899e4c84456bfc1de3436accf4a>:0) DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet1[T] filesToNotOverwrite) (at <68089899e4c84456bfc1de3436accf4a>:0)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <68089899e4c84456bfc1de3436accf4a>:0)
Rethrow as BuildFailedException: Exception of type ‘UnityEditor.Build.BuildFailedException’ was thrown.
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <68089899e4c84456bfc1de3436accf4a>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <68089899e4c84456bfc1de3436accf4a>: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 <68089899e4c84456bfc1de3436accf4a>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Can you have a look a the contents of this file? C:\Users\ships\AppData\Local\Temp\tmpB6F9.tmp

This is a text file which contains all of the object files (.obj) that the linker will use as input. One of them (11D6A022F55B910870D4A6767364587E.obj) has some kind of problem. Once you locate that file on disk, delete it (and maybe all of the other object files listed) and build again.

The developer and I made a bug report , its a unity bug from Trilib2 Asset Please check the bug report from the developer so we can work on a fix cause i need that

1 Like

Forgot to send the report from the author https://fogbugz.unity3d.com/default.asp?1409696_ne1rshv0ffvdjr0p