install dioxus-cli failed linking with `link.exe` failed: exit code: 1120
Problem
run cargo install dioxus-cli failed
Steps To Reproduce
Steps to reproduce the behavior:
- cargo install dioxus-cli
Expected behavior
Screenshots
Environment:
- Dioxus version:
- Rust version:
- OS info: windows11
- App platform:
cargo version
cargo 1.87.0-nightly (ab1463d63 2025-03-08)rustup toolchainnightly-x86_64-pc-windows-msvc (active, default)cmake versioncmake version 4.0.0-rc4
Questionnaire
error log
Compiling rav1e v0.7.1
error: linking with `link.exe` failed: exit code: 1120
|
= note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\79902\\AppData\\Local\\Temp\\rustc8wbVeT\\symbols.o" "<2 object files omitted>" "C:\\Users\\79902\\release\\deps/{libbuilt-36107875621de8c2.rlib,libgit2-7e8af9591ebf5401.rlib,liburl-6463e86e91f07fc9.rlib,libidna-9ebc3df6f27c522c.rlib,libidna_adapter-451adbe99971b954.rlib,libicu_normalizer-3f75f5059429282f.rlib,libicu_normalizer_data-05095776ea072ed5.rlib,libwrite16-5e56e752b04c2b17.rlib,libutf8_iter-6adb628a10415b9e.rlib,libutf16_iter-ca2825ff8668a22a.rlib,libsmallvec-eee806cc8c9012f7.rlib,libicu_properties-1f47e5c531e37c2a.rlib,libicu_properties_data-89ecf6e403d39a51.rlib,libicu_locid_transform-4ed754e47940edd6.rlib,libicu_locid_transform_data-eccbf9c57fdfe30c.rlib,libicu_collections-90ca11b238ef288d.rlib,libicu_provider-fac28b0614886b75.rlib,libicu_locid-2ab97f5e3be961b2.rlib,liblitemap-d4eca3f22f46da36.rlib,libtinystr-2ba76951dece352c.rlib,libzerovec-d861b721236a72da.rlib,libwriteable-173e461c0b4d2dab.rlib,libyoke-f4ec119525a1661f.rlib,libzerofrom-fb5767dbcf77d620.rlib,libstable_deref_trait-7455e50933e77bca.rlib,libform_urlencoded-e4699397ca248eb7.rlib,libpercent_encoding-1ec21ceb5b008fa2.rlib,liblog-00659db7b1d77bef.rlib,liblibgit2_sys-800a9225f8e3817d.rlib,liblibz_sys-28d3ec5d8cbcc4c3.rlib,liblibc-5ece303877750151.rlib,libbitflags-c8c94657cfe0541b.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "winhttp.lib" "rpcrt4.lib" "ole32.lib" "crypt32.lib" "secur32.lib" "legacy_stdio_definitions.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\79902\\./release\\build\\libgit2-sys-981088c4172e8832\\out\\build" "/LIBPATH:C:\\Users\\79902\\./release\\build\\libz-sys-be038c028a5bc1c1\\out\\lib" "/LIBPATH:C:\\Users\\79902\\./release\\build\\libz-sys-be038c028a5bc1c1\\out\\lib" "/OUT:C:\\Users\\79902\\./release\\build\\rav1e-74d0704a20d528f4\\build_script_build-74d0704a20d528f4.exe" "/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libstd.natvis"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: Creating library C:\Users\79902\.\release\build\rav1e-74d0704a20d528f4\build_script_build-74d0704a20d528f4.lib and object C:\Users\79902\.\release\build\rav1e-74d0704a20d528f4\build_script_build-74d0704a20d528f4.exp␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_OpenProcessToken referenced in function current_user_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_CheckTokenMembership referenced in function git_fs_path_owner_is␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_CopySid referenced in function sid_dup␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_EqualSid referenced in function git_fs_path_owner_is␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_GetLengthSid referenced in function sid_dup␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_GetTokenInformation referenced in function current_user_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_IsValidSid referenced in function file_owner_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_IsWellKnownSid referenced in function git_fs_path_owner_is␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_GetNamedSecurityInfoW referenced in function file_owner_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(43a19b30e9e69d8f-sysdir.o) : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function lookup_registry_key␍
liblibgit2_sys-800a9225f8e3817d.rlib(43a19b30e9e69d8f-sysdir.o) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExW referenced in function lookup_registry_key␍
liblibgit2_sys-800a9225f8e3817d.rlib(43a19b30e9e69d8f-sysdir.o) : error LNK2019: unresolved external symbol __imp_RegQueryValueExW referenced in function lookup_registry_key␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-rand.o) : error LNK2019: unresolved external symbol __imp_CryptAcquireContextA referenced in function getseed␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-rand.o) : error LNK2019: unresolved external symbol __imp_CryptReleaseContext referenced in function getseed␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-rand.o) : error LNK2019: unresolved external symbol __imp_CryptGenRandom referenced in function getseed␍
C:\Users\79902\.\release\build\rav1e-74d0704a20d528f4\build_script_build-74d0704a20d528f4.exe : fatal error LNK1120: 15 unresolved externals␍
Compiling dioxus-cli v0.6.3
error: could not compile `rav1e` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: linking with `link.exe` failed: exit code: 1120
|
= note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\79902\\AppData\\Local\\Temp\\rustcOnD4DA\\symbols.o" "<2 object files omitted>" "C:\\Users\\79902\\release\\deps/{libbuilt-36107875621de8c2.rlib,libgit2-7e8af9591ebf5401.rlib,liburl-6463e86e91f07fc9.rlib,libidna-9ebc3df6f27c522c.rlib,libidna_adapter-451adbe99971b954.rlib,libicu_normalizer-3f75f5059429282f.rlib,libicu_normalizer_data-05095776ea072ed5.rlib,libwrite16-5e56e752b04c2b17.rlib,libutf8_iter-6adb628a10415b9e.rlib,libutf16_iter-ca2825ff8668a22a.rlib,libsmallvec-eee806cc8c9012f7.rlib,libicu_properties-1f47e5c531e37c2a.rlib,libicu_properties_data-89ecf6e403d39a51.rlib,libicu_locid_transform-4ed754e47940edd6.rlib,libicu_locid_transform_data-eccbf9c57fdfe30c.rlib,libicu_collections-90ca11b238ef288d.rlib,libicu_provider-fac28b0614886b75.rlib,libicu_locid-2ab97f5e3be961b2.rlib,liblitemap-d4eca3f22f46da36.rlib,libtinystr-2ba76951dece352c.rlib,libzerovec-d861b721236a72da.rlib,libwriteable-173e461c0b4d2dab.rlib,libyoke-f4ec119525a1661f.rlib,libzerofrom-fb5767dbcf77d620.rlib,libstable_deref_trait-7455e50933e77bca.rlib,libform_urlencoded-e4699397ca248eb7.rlib,libpercent_encoding-1ec21ceb5b008fa2.rlib,liblog-00659db7b1d77bef.rlib,liblibgit2_sys-800a9225f8e3817d.rlib,liblibz_sys-28d3ec5d8cbcc4c3.rlib,liblibc-5ece303877750151.rlib,libbitflags-c8c94657cfe0541b.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "winhttp.lib" "rpcrt4.lib" "ole32.lib" "crypt32.lib" "secur32.lib" "legacy_stdio_definitions.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\79902\\./release\\build\\libgit2-sys-981088c4172e8832\\out\\build" "/LIBPATH:C:\\Users\\79902\\./release\\build\\libz-sys-be038c028a5bc1c1\\out\\lib" "/LIBPATH:C:\\Users\\79902\\./release\\build\\libz-sys-be038c028a5bc1c1\\out\\lib" "/OUT:C:\\Users\\79902\\./release\\build\\dioxus-cli-ad6a4b0fc3dfa00f\\build_script_build-ad6a4b0fc3dfa00f.exe" "/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libstd.natvis"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: Creating library C:\Users\79902\.\release\build\dioxus-cli-ad6a4b0fc3dfa00f\build_script_build-ad6a4b0fc3dfa00f.lib and object C:\Users\79902\.\release\build\dioxus-cli-ad6a4b0fc3dfa00f\build_script_build-ad6a4b0fc3dfa00f.exp␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_OpenProcessToken referenced in function current_user_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_CheckTokenMembership referenced in function git_fs_path_owner_is␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_CopySid referenced in function sid_dup␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_EqualSid referenced in function git_fs_path_owner_is␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_GetLengthSid referenced in function sid_dup␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_GetTokenInformation referenced in function current_user_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_IsValidSid referenced in function file_owner_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_IsWellKnownSid referenced in function git_fs_path_owner_is␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-fs_path.o) : error LNK2019: unresolved external symbol __imp_GetNamedSecurityInfoW referenced in function file_owner_sid␍
liblibgit2_sys-800a9225f8e3817d.rlib(43a19b30e9e69d8f-sysdir.o) : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function lookup_registry_key␍
liblibgit2_sys-800a9225f8e3817d.rlib(43a19b30e9e69d8f-sysdir.o) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExW referenced in function lookup_registry_key␍
liblibgit2_sys-800a9225f8e3817d.rlib(43a19b30e9e69d8f-sysdir.o) : error LNK2019: unresolved external symbol __imp_RegQueryValueExW referenced in function lookup_registry_key␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-rand.o) : error LNK2019: unresolved external symbol __imp_CryptAcquireContextA referenced in function getseed␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-rand.o) : error LNK2019: unresolved external symbol __imp_CryptReleaseContext referenced in function getseed␍
liblibgit2_sys-800a9225f8e3817d.rlib(f6e81ea219c0b9f3-rand.o) : error LNK2019: unresolved external symbol __imp_CryptGenRandom referenced in function getseed␍
C:\Users\79902\.\release\build\dioxus-cli-ad6a4b0fc3dfa00f\build_script_build-ad6a4b0fc3dfa00f.exe : fatal error LNK1120: 15 unresolved externals␍
error: could not compile `dioxus-cli` (build script) due to 1 previous error
error: failed to compile `dioxus-cli v0.6.3`, intermediate artifacts can be found at `C:\Users\79902\./`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
the same problem....
Currently you can solve this problem by using stable rust, I had the same problem, but it compiled successfully after switching to stable-x86_64-pc-windows-msvc, rust version 1.86.0 (05f9846f8 2025-03-31).
stable-x86_64-pc-windows-msvc stable-x86_64-pc-windows-gnu rustc1.87.0 meet this error too. I don't know what the principle is, but after installing the latest dioxus-cli 0.7 alpha version, rav1e 0.7.1 passed compilation without generating any errors, this issue didn't seem to have any need to be discussed anymore .
same issue here
Having the same issue, trying to change some versions of nasm without success – can't find a way to build this – strange.
You may be missing one of these build dependencies: https://github.com/xiph/rav1e?tab=readme-ov-file#dependency-nasm
We provide prebuilt binaries for the CLI you can install with cargo binstall diouxs-cli for the latest release or cargo binstall [email protected] for the alpha release which don't require you to install those build dependencies
@ealmloff i needed to compile v0.6.3 explicitly to apply this PR https://github.com/DioxusLabs/dioxus/pull/3753 – i can't just use the prebuilt one because it does not include it, neither does 0.7 which i can build but the PR is not compatible anymore. I have found a convoluted workaround though so its not necessary for me anymore to release my application. Looks like this is not really a dependency issue others have the same problem i guess. https://github.com/xiph/rav1e/issues/3438 but i don't think its worth it to investigate further.
I've also been having this issue on my GitHub workflow runner but with stable Rust.
This question may be the same with git2-rs Windows build does not link with Advapi32.lib #1142 caused by Windows: Don't link std (and run-make) against advapi32, except on win7 #138233.