LINK : fatal error LNK1104: cannot open file

When doing the tutorial nº5, I obtain the following error when building with “development editor”. However using “debug game editor” the code is compiled correctly.

1>------ Build started: Project: TutorialCode, Configuration: Development_Editor x64 ------
1> Parsing headers for TutorialCodeEditor
1>LogTextLocalizationManager : warning : The selected culture ‘es_ES’ is not available; falling back to ‘en’
1> Code generation finished for TutorialCodeEditor and took 4,13
1> Performing 2 actions (max 4 parallel jobs)
1> TutorialCodeCharacter.cpp
1> [2/2] link.exe UE4Editor-TutorialCode.dll
1>LINK : fatal error LNK1104: cannot open file ‘C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode.dll’
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode.pdb
1> Cumulative action seconds (8 processors): 0,00 building projects, 0,55 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,12 linking, 0,00 other
1> UBT execution time: 9,18 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““C:\Program Files\Unreal Engine\4.2\Engine\Build\BatchFiles\Build.bat” TutorialCodeEditor Win64 Development “C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\TutorialCode.uproject” -rocket” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

4 Likes

Try to rebuild your project

Thank you. I tried but It failed too:

1>------ Rebuild All started: Project: TutorialCode, Configuration: Development_Editor x64 ------
1> Cleaning TutorialCodeEditor Binaries…
1>EXEC : error : System.UnauthorizedAccessException: Acceso denegado a la ruta de acceso ‘C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode.dll’.
1> en UnrealBuildTool.UEBuildTarget.CleanFile(String Filename)
1> en UnrealBuildTool.UEBuildTarget.CleanTarget(List1 Binaries, CPPTargetPlatform Platform, FileManifest Manifest) 1> en UnrealBuildTool.UEBuildTarget.GenerateManifest(List1 Binaries, CPPTargetPlatform Platform, List1 SpecialRocketLibFilesThatAreBuildProducts) 1> en UnrealBuildTool.UEBuildTarget.Build(List1 OutputItems)
1> en UnrealBuildTool.UnrealBuildTool.RunUBT(String[] Arguments)
1> Parsing headers for TutorialCodeEditor
1>LogTextLocalizationManager : warning : The selected culture ‘es_ES’ is not available; falling back to ‘en’
1> Code generation finished for TutorialCodeEditor and took 5,598
1> Performing 1 actions (max 4 parallel jobs)
1> [1/1] link.exe UE4Editor-TutorialCode.dll
1>LINK : fatal error LNK1104: cannot open file ‘C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode.dll’
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode.pdb
1> Cumulative action seconds (8 processors): 0,00 building projects, 0,00 compiling, 0,00 creating app bundles, 0,00 generating debug info, 0,17 linking, 0,00 other
1> UBT execution time: 11,00 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(43,5): error MSB3073: The command ““C:\Program Files\Unreal Engine\4.2\Engine\Build\BatchFiles\Rebuild.bat” TutorialCodeEditor Win64 Development “C:\Users\Sergio\Documents\Unreal Projects\TutorialCode\TutorialCode.uproject” -rocket” exited with code 2.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

It seems the error is a denegation acces to UE4Editor-TutorialCode.dll

Ok I solved it. If anyone has the same error, to resolve it simply close the ue4 while compilling xD

6 Likes

For me, it seemed that a rogue Visual Studio process was causing this problem.

1 Like

I fixed this error by simply deleting everything in the “MyProject\Binaries\Win64”

10 Likes

This^ actually fixed my issue for 4.26.2. Thank you for suggesting it. Much appreciated

1 Like

This worked for me in UE 5.0.1

2 Likes

Thank you! this fixed it for me as well

It fix my problem too

Thanks a lot it resolve my issue for UE 5.1 too by deleting all files under [ProjectPath]/Engine/Binaries/Win64 . My issue is:
1 built successfully for several times;
2 fail to build for LINK1104. (my case are RemoteControlMIDIEditor.supperess.exe and another (forget about the name)). Those files maybe poluted during the long period of building(PC may get into the sleep mode and then I waked it up to continue building process).

Notice: pure “Clean” for the project in VS2022 did not work.

Thank you so much sir/ma you really helped me✌🏼

Thanks Wheeze this solved my issue too! Deleting everything under MyProject/Binaries/Win64 worked!!

This worked for me, thanks!

Just to add to this old thread (since I ended up here with the same issue…)

In my case, it was that my binaries were on source control (P4V), which had made them read only - disabling the ‘read only’ flag fixed the issue.

This might also be how others managed to fix this by deleting and re gen, as it may have just cleared flags in the process.

I have had similar issue with UE5 and other software when the files were stored in a Dropbox or similar backup system too, so watch out for that also.

Good luck, future travellers of this thread!

it cannot help me