DioxusLabs/dioxus

`dx serve --hot-patch` on Windows 11 cannot generate binary outside of VS command prompt

Open

#4,911 创建于 2025年11月5日

在 GitHub 查看
 (1 评论) (1 反应) (0 负责人)Rust (36,038 star) (1,655 fork)batch import
bughelp wantedsubsecondwindows

描述

Problem

A freshly created, barebones desktop project on Windows, launched with dx serve --hot-patch will fail to build with a number of linker errors looking for core windows libraries.

Steps To Reproduce

  • open any terminal that is not the VS 2022 Native Tools Command Prompt
    • for the purposes of this report, I have tried nushell, Powershell, and a vanilla Command Prompt
  • create a new Dioxus project with dx new
  • Bare-Bones for sub-template
  • false for Dioxus Fullstack
  • false for Dioxus Router
  • false for Tailwind CSS
  • false for LLM prompts
  • Desktop for Platform
  • cd to new project directory
  • dx serve --hotpatch to run

The build will then fail when looking for system libraries:

22:51:23 [dev] Failed to generate fat binary: rust-lld: error: could not open 'shlwapi.lib': no such file or directory
rust-lld: error: could not open 'advapi32.lib': no such file or directory
rust-lld: error: could not open 'kernel32.lib': no such file or directory
rust-lld: error: could not open 'kernel32.lib': no such file or directory
rust-lld: error: could not open 'kernel32.lib': no such file or directory
rust-lld: error: could not open 'ntdll.lib': no such file or directory
rust-lld: error: could not open 'userenv.lib': no such file or directory
rust-lld: error: could not open 'ws2_32.lib': no such file or directory
rust-lld: error: could not open 'dbghelp.lib': no such file or directory
rust-lld: error: could not open 'uuid.lib': no such file or directory
rust-lld: error: could not open 'ole32.lib': no such file or directory
22:51:23 [dev] Build failed: Failed to read file: The system cannot find the file specified. (os error 2)
               1: The system cannot find the file specified. (os error 2)

However, running under the x64 Native Tools Command Prompt, the project will build and run just as expected, so this will function as a workaround.

Expected behavior

I expect that dx serve --hot-patch on Windows will function the same no matter matter the shell, assuming that regular rust programs are able the be compiled and run under those same shell environments with no modifications.

Environment:

  • Dioxus version: 0.7.0, main branch for dx-cli Windows launch fix
  • Rust version: 1.91.0 (f8297e351 2025-10-28)
  • OS info: Windows 11
  • App platform: Desktop

贡献者指南