Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross build from mac to windows 10 cannot be launched with 'cannot find webview2loader.dll' #899

Closed
AllenDang opened this issue Mar 21, 2023 · 6 comments
Labels
desktop Suggestions related to the desktop renderer

Comments

@AllenDang
Copy link

Problem

I cross build from mac to windows with following command.

cargo build --release --target=x86_64-pc-windows-gnu

Launch it on windows 10 give me an error message says "cannot find webview2loader.dll".

I followed the instruction on https://developer.microsoft.com/zh-cn/microsoft-edge/webview2/#download-section and installed the edge webview2 runtime.

Issue persists.

Expected behavior

Application could be launched normally on windows 10.

Environment:

  • Dioxus version: 0.3.2
  • Rust version: 1.68
  • OS info: windows 10
  • App platform: desktop
@ealmloff ealmloff added the desktop Suggestions related to the desktop renderer label Mar 22, 2023
@ealmloff
Copy link
Member

Tauri doesn't officially support windows-gnu. If you switch targets to x86_64-pc-windows-msvc, the msvc target is supported

@AllenDang
Copy link
Author

@Demonthos mcvc toolchain cannot run in macOS, at least I didn't find a proper way, do you know how?

@arqalite
Copy link
Contributor

@AllenDang Check out https://github.com/rust-cross/cargo-xwin.

cargo xwin build --target x86_64-pc-windows-msvc works on Linux and generates a working EXE binary. I don't own any Apple devices so I can't test on macOS.

@shivaraj-bh
Copy link

I don't own any Apple devices so I can't test on macOS.

I can confirm that it works on macOS too

@pascalbehmenburg
Copy link
Contributor

pascalbehmenburg commented Dec 11, 2023

Running the suggested setup as follows on macOS:

rustup target add x86_64-pc-windows-msvc
cargo install cargo-xwin
cargo xwin build --target x86_64-pc-windows-msvc

^the above requires clang and llvm to be installed or rustup component add llvm-tools-preview as can be read in the cargo-xwin docs.

The binary compiles perfectly fine, as you can see here (running on windows):

explorer_UmrGsmLskg

This issue may be closed. One could consider documenting these steps to cross-compile, although I'd say this is a pretty standard approach to cross-compilation when targeting msvc. Maybe one could state somewhere that Tauri does only compile for msvc target, so it is more obvious.

@ealmloff
Copy link
Member

This issue may be closed. One could consider documenting these steps to cross-compile, although I'd say this is a pretty standard approach to cross-compilation when targeting msvc. Maybe one could state somewhere that Tauri does only compile for msvc target, so it is more obvious.

This was fixed in #1681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Suggestions related to the desktop renderer
Projects
None yet
Development

No branches or pull requests

5 participants