M
Modular•13mo ago
Osama-Logic

How to build windows exe ?

How to build window exe ? , And how to develop a simple hello world gui ?
25 Replies
lynet_101
lynet_101•13mo ago
1. I don't think it's possible to build an exe just yet 2. what do you mean hello world gui? do you mean a simple hello world program, or do you mean a bare bones window?
littlewolf
littlewolf•13mo ago
It may not build an exe now because it doesn't support now.
TeamPuzel
TeamPuzel•13mo ago
You will be able to do it like this, however you would need the microsoft toolchain
> mojo build ./test.mojo --target-triple x86_64-pc-win32
mojo: error: Couldn't find msvc toolchain.
> mojo build ./test.mojo --target-triple x86_64-pc-win32
mojo: error: Couldn't find msvc toolchain.
To make a gui you would need to use X11 which I don't think is being linked currently, and you can't pass custom linker flags
Osama-Logic
Osama-Logic•13mo ago
Thank you all for reply , but is that mean that i have to wait for newer versions or is there a way with a more steps to go through to develop a basic windows desktop app ?
TeamPuzel
TeamPuzel•13mo ago
It means you have to wait, this is still very early for Mojo. Most languages you might know were released years, often decades in the past, meanwhile mojo a few days ago :) But I don't think it will take too long
Osama-Logic
Osama-Logic•13mo ago
I know but you know the one feeling very enthusiastic to start developing from day 0, but any way thank you 🙂
TeamPuzel
TeamPuzel•13mo ago
Yeah, for now people are still experimenting with implementing basic data structures like arrays. GUI applications have to wait a bit
Osama-Logic
Osama-Logic•13mo ago
but then what will be the uses for the mojo build command ? i mean in this version ?
TeamPuzel
TeamPuzel•13mo ago
you mean the target command? the mojo build command works, it's just that you're limited to Linux right now They are working on mac and windows support still, but I would expect windows to come a bit later as it's very different from Linux and macOS.
Osama-Logic
Osama-Logic•13mo ago
Well as you said we will have to wait @TeamPuzel one more question if you please , i tried installing gcc-mingw-w64 will it help in any way ? , when trying the exe in windows it gives me this error " is not compatible with the v ersion of Windows you're running. Check your computer's system information and t hen contact the software publisher. "
TeamPuzel
TeamPuzel•13mo ago
I don't understand, you were able to compile with --target-triple x86_64-pc-win32 ??
Osama-Logic
Osama-Logic•13mo ago
i used this line " mojo build testmojo.mojo --target-triple x86_64-w64-mingw32 -o testmojo.exe
TeamPuzel
TeamPuzel•13mo ago
and what did you get? an exe? I'm pretty sure if you force it to name it exe it will even if it isn't
Osama-Logic
Osama-Logic•13mo ago
" -o testmojo.exe " i named it testmojo.exe and it gave me testmojo.exe but in windows it give me the version error ?!
TeamPuzel
TeamPuzel•13mo ago
don't use -o will it still make an "exe"?
Want results from more Discord servers?
Add your server