LINK : fatal error LNK1181: cannot open input file

LINK : fatal error LNK1181: cannot open input file 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\lib\x64\legacy_stdio_wide_specifiers.lib'

im trying to compile with live coding it looks like a file is missing

im not really sure what to do here

i checked visual studio installation unreal and c++ workloads are installed

seems that 14.35.32215 and 14.33.31629 exists but not 14.34.31933

so i need to change that somehow…

1 Like

I haven’t coded in a while and just started again today and had pretty much the same error. The only difference is that it cannot open from MSVC\14.33.31629.…
I tried just manually creating that folder and throwing the file from my current MSVC installation and got pretty much the same error just for MSVCRT.lib instead of specifier.lib
Do you know if you’ve used unreal since your last visual studio update? My theory is that it’s looking for the old version of visual studio it’s been using that no longer exists. Hopefully someone replies soon with a fix.
Edit: I copied my whole 14.35.32215 MSVC folder and renamed the copy in the same location to 14.33.31629 and that appears to be a temporary fix for now, though live coding seems to take longer than normal.

I use visual studio code as default code editor. I updated visual studio, reinstalled as well. I also verified the engine files. Still the same error.

I verified Visual Studio which for some reason deleted Unreal. So then I reinstalled Unreal and now I get a different error:

Could not spawn process C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\link.exe. Error: 267
Failed to link patch (0.000s) (Exit code: 0xFFFFFFFF)

Turns out the problem is most likely to be with live coding.
Because everything compiles successfully with visual studio code build tasks and manual compile in unreal.
And yes I did reinstall the engine, visual studio, verified all the files, like 3 times over the past 2 days.
But I have no idea why only live coding has issues…
Still get the same error while using live coding:

Could not spawn process C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\link.exe. Error: 267
Failed to link patch (0.000s) (Exit code: 0xFFFFFFFF)

What version of Unreal are you using? I was using Unreal 5.0.2 at the time of having the original error but after upgrading to 5.2 live coding appears to use the proper MSVC folder. Not sure about your new error but it’s possible updating to 5.2 might also fix that one too. Also are you using the epic launcher to install Unreal Engine? So far I’ve found that to be the easiest way to install and update unreal but I’ve not tried any other methods too extensively.

I got an error link.exe. Error: 267 on version 5.2, my actions were as follows: Started VS recovery in Visual Studio Installer, after recovery I had Unreal and Epic Launcher disappeared, installed them, then I had to clear folder in Binaries project and compile through Unreal startup. The problem was solved.

Had a similar error and thought I’d post my solution. error was: LINK : fatal error LNK1181: cannot open input file ‘C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\lib\x64\legacy_stdio_wide_specifiers.lib’

I’m using Unreal 5.1.0 and it seems the MSVC package from visual studio it uses is no longer supported, visual studio replaced it with the new one during some update and that’s the issue. I fixed it by installing the right package manually: visual studio installer → modify → individual components and then picking the MSVC package it was looking for, for unreal 5.1.0 is MSCV v143 - VS 2022 C++ x64/x86 build tools (v14.35 - 17.5). Updating to unreal 5.2 would likely fix the issue too as 5.2 probably looks for the currently supported MSVC package.

1 Like

I’m having similar issue with 5.3.
I’ve tried:

  • Removing separate MSBuild tools;
  • Completely uninstalling VS studio and everything related + reinstalling;
  • Repairing VS studio installation;
  • Tried manually replacing 17.7 build tools with v17.6.7;

Live Coding outputs this:

LINK : fatal error LNK1181: cannot open input file ‘C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\lib\x64\legacy_stdio_wide_specifiers.lib’

It drives me nuts. MSBuild tools are the worst dev nightmare.
If anyone has the solution, please let me know.

1 Like

I was getting “LINK : fatal error LNK1181: cannot open input file ‘C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\lib\x64\legacy_stdio_wide_specifiers.lib’” when trying to update with live coding. I saw I had MSVC\14.36.32215 so I did what Drunken_Seagull was explaining about installer → modify → individual components, MSCV v143 - VS 2022 C++ x64/x86 build tools (v14.35 - 17.5). That worked on Unreal Engine 5.3

1 Like

How did you manage to force the Unreal to link with lower version of MSVC?

I’ve tried similar, but no matter what I do, Unreal just picks higher version for linking.
Which is just the one that comes with the Visual Studio.

Even when building with lower version. E.g.:

Using Visual Studio 2022 14.35.32217 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
...
LINK : fatal error LNK1181: cannot open input file 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\lib\x64\legacy_stdio_wide_specifiers.lib'
Failed to link patch (0.000s) (Exit code: 0x49D)

Edit:
Tried deleting Visual Studio completely, installing MSBuild tools separately & copying 14.35 version and pasting at exact path it tries to link libs from.

That bypasses MSVC issue.
But now I just get same error (LNK1181) upon attempting to link modules from the project Intermediates.

E.g.

LINK : fatal error LNK1181: cannot open input file 'D:\*projectPath*\Intermediate\Build\Win64\x64\UnrealEditor\Development\FlecsLibrary\UnrealEditor-FlecsLibrary.lib'
Failed to link patch (0.000s) (Exit code: 0x49D)

I deleted Binaries & Intermediate & DerivedDataCache directories in project directory, then right click .uproject → Generate Visual Studio project files, now it works.

8 Likes

That’s of pretty much help!

Using that exact version fixed for me. Thank you.

I had exactly the same problem. It is like this:

LINK : fatal error LNK1181: cannot open input file “D:\Apps\Visual Studio\Visual Studio 2022\VC\Tools\MSVC\14.38.33130\lib\x64\legacy_stdio_wide_specifiers.lib”

And I fixed the problem also by installing corresponding version of msvc build tool(14.38.33130 for me) in the VisualStudio Installer. I have wondered whether “MSCV v148 - VS 2022 C++ x64/x86 build tools (v14.38 - 17.8)” actually means the version “14.38.33130” or not, but luckily it does.

Step 1: Check Visual Studio Installation

  1. Open Visual Studio Installer:
  • Open the Start menu, search for Visual Studio Installer, and open it.
  1. Modify the Visual Studio Installation:
  • In the Visual Studio Installer, find your Visual Studio 2022 installation and click Modify.
  1. Check Required Components:
  • Make sure that the necessary components for C++ development are installed, including:
    • Desktop development with C++
    • Game development with C++
  • Ensure the latest updates for these components are installed.

Step 2: Verify Path to the Library

  1. Navigate to the Path:
  • Open File Explorer and navigate to the following path: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\lib\x64\.
  • Check if legacy_stdio_wide_specifiers.lib exists in this directory.
  1. Reinstall Missing Components:
  • If the file is missing, reinstalling or repairing the Visual Studio installation may help restore it.

Step 3: Update Unreal Engine Project Settings

  1. Open Unreal Engine:
  • Open your project in Unreal Engine.
  1. Go to Project Settings:
  • From the top menu bar, select Edit > Project Settings.
  1. Navigate to Platforms:
  • On the left panel, go to Platforms > Windows.
  1. Update Compiler Version:
  • Ensure the Visual Studio version is set to the correct version you have installed (e.g., Visual Studio 2022).

Step 4: Regenerate Project Files

  1. Close Unreal Engine.
  2. Delete the .sln File:
  • Delete the solution file (.sln) in your project directory.
  1. Generate Visual Studio Project Files:
  • Right-click on your .uproject file and select Generate Visual Studio project files.

Step 5: Clean and Rebuild Project

  1. Open the Project in Visual Studio Code:
  • Open Visual Studio Code and load your project folder.
  1. Clean the Project:
  • Use the build system in Visual Studio Code to clean the project.
  • You can usually find this option in the Terminal or by pressing Ctrl+Shift+B and selecting a clean task.
  1. Rebuild the Project:
  • Rebuild the project to ensure all dependencies are correctly linked.

Additional Troubleshooting

If the issue persists, consider the following:

  • Ensure All Environment Variables Are Set Correctly: Sometimes, missing or incorrect environment variables can cause linking issues.
  • Check for Any Missing Dependencies: Make sure all necessary libraries and dependencies are installed and correctly referenced in your project.

By following these steps, you should be able to resolve the linking error and get your project compiling correctly. If you encounter any other specific error messages, please share them, and I’ll help troubleshoot further.

1 Like