-
Notifications
You must be signed in to change notification settings - Fork 631
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
Error cross-compiling with C++ from Linux to Windows #2508
Comments
Hi Guilllaume! I suspect that this may be related to Corrosion, how it invokes cargo/rustc, and whether it's aware of the cross-compilation situation. Are you using a cmake toolchain file by chance with your cmake build? Or how do you instruct CMake to use a cross-compiler for C++ code to compile for windows? A quick search on Google suggests that setting Could you describe your setup a little, maybe I can reproduce this issue myself. |
Here are some info about the host :
rust info: Default host: x86_64-unknown-linux-gnu installed targets for active toolchain:
active toolchain:
My folders architecture: /app contains two folders (src and build) Commands used I execute theses commands in this order (in build folder):
CMakeLists.txt:
slint_hello.cpp
slint_hello_ui.slint:
The context, i use debian to compile a windows program (cross-compilation). Thanks in advance for your help ! |
Hello @tronical , do you need any more info or do you want me to try something ? |
I try to add set(CMAKE_CROSSCOMPILING true) but it don't change the result the system host name let cmake know we are cross compiling it seems. Do you succeed to reproduce the same problem @tronical ? |
Thanks for the info (and thanks for your patience:). The cmake project looks good to me. So not entirely sure what's causing this. @jschwe , do you know if this kind of cross-build from Linux host to mingw should work with Corrosion? |
@tronical The corrosion |
Thanks for the quick response. I see, this is why cross-compilation between linux host and target works - almost by chance, because there's no such difference (executable suffix). |
@GuillaumeSavin I'm afraid the consequence is that currently cross-compiling the C++ build of Slint from Linux to Windows isn't supported :-( |
corrosion-rs/corrosion#437 fixes the other way around (windows to non-windows) |
Hello Slint team,
Today i try to cross compile (i built on linux targetting windows) a program using slint ui and built in the same time slint compiler (https://slint-ui.com/releases/1.0.0/docs/cpp/cmake.html#building-from-sources).
But during the step
cmake --build .
, My theory is that cmake think that slint compiler should be a windows binary as well as the program I try to build. But as I built on linux, slint compiler is built as linux binary so when copying the slint-compiler, cmake use the wrong extension:Here is the list of command i executed in /app/build:
I will send you the files i used during the process in attachment
slint_hello.zip
And my files is located as in the capture
Thanks you in advance !
The text was updated successfully, but these errors were encountered: