E1883: the Windows libraries for linking are missing
A hosted Windows program is linked against the MSVC runtime libraries (libcmt.lib) and the Windows SDK libraries (kernel32.lib, libucrt.lib and their neighbours).
A hosted Windows program is linked against the MSVC runtime libraries
(libcmt.lib) and the Windows SDK libraries (kernel32.lib, libucrt.lib
and their neighbours). Actus links with its own bundled LLD but does not ship
those libraries (ADR-0138). When LIB is not set, the compiler looks for them
in the places a Visual Studio or Build Tools installation puts them; this error
means it found a part missing. It is an error of the machine and of no file of
the project, so it prints as error[E1883]: message, with no path, before any
linker runs. The message names what is missing (the MSVC toolset, the Windows
SDK, or both), every place that was searched for it, and what to install:
The same code reports a target whose architecture has no Windows library
directory (for example riscv64) when LIB is not set.
Cause
actus build or actus run links a hosted *-windows-msvc program on a
Windows host, LIB is not set (a plain Command Prompt or PowerShell does not
set it), and one of these is not found:
- the MSVC toolset:
VCToolsInstallDir, then the latest Visual Studio thatvswhere.exereports with the MSVC x86/x64 tools, with aVC\Tools\MSVC\<version>\lib\<arch>\libcmt.lib; - the Windows SDK:
WindowsSdkDirwithWindowsSDKLibVersion, then the Windows Kits 10 root of the registry or%ProgramFiles(x86)%\Windows Kits\10, with aLib\<version>that hasum\<arch>\kernel32.libanducrt\<arch>\libucrt.lib.
A program cannot trigger this error on purpose, so it has no example.
Fix
Install "Build Tools for Visual Studio" and select the "Desktop development
with C++" workload; it brings the MSVC toolset and a Windows SDK. Or run
actus from a Developer Command Prompt for Visual Studio, which sets LIB.
Setting ACTUS_LINKER or linker in Actus.toml selects another linker but
does not remove the need for the libraries.
Run actus explain E1883 in your terminal to read this entry offline. Browse Strict & toolchain or all error codes.