M
Modular•16mo 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•16mo 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•16mo ago
It may not build an exe now because it doesn't support now.
TeamPuzel
TeamPuzel•16mo 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-LogicOP•16mo 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•16mo 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-LogicOP•16mo ago
I know but you know the one feeling very enthusiastic to start developing from day 0, but any way thank you 🙂
TeamPuzel
TeamPuzel•16mo 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-LogicOP•16mo ago
but then what will be the uses for the mojo build command ? i mean in this version ?
TeamPuzel
TeamPuzel•16mo 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-LogicOP•16mo 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•16mo ago
I don't understand, you were able to compile with --target-triple x86_64-pc-win32 ??
Osama-Logic
Osama-LogicOP•16mo ago
i used this line " mojo build testmojo.mojo --target-triple x86_64-w64-mingw32 -o testmojo.exe
TeamPuzel
TeamPuzel•16mo 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-LogicOP•16mo 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•16mo ago
don't use -o will it still make an "exe"?
Osama-Logic
Osama-LogicOP•16mo ago
it export with no exe
TeamPuzel
TeamPuzel•16mo ago
yeah you could put -o testmojo.anything it's not that smart you decide the name if you use o
Osama-Logic
Osama-LogicOP•16mo ago
so using gcc-mingw-w64 won't help right ?!
ModularBot
ModularBot•16mo ago
Congrats @Osama-Logic, you just advanced to level 2!
TeamPuzel
TeamPuzel•16mo ago
I think this might be a bit broken I do not know unfortunately.
Osama-Logic
Osama-LogicOP•16mo ago
Well thank you for your help 🙂 Please If you found any info on the matter please let me know
TeamPuzel
TeamPuzel•16mo ago
sure!
ziyu4huang
ziyu4huang•16mo ago
run GUI? , I think just use mojo->Python. Develop full stack to replace Python is not the main goal for now . IMO.
cksiow
cksiow•15mo ago
@Osama-Logic I think you must set --target-triple to x86_64-pc-win32 instead of x86_64-w64-mingw32, in fact you can set "x86_64-w64-mingw", "x86_64-w64-ming" etc, it will compile and for what i can see is mojo will fallback to default (linux) if --target-triple cannot be found
Osama-Logic
Osama-LogicOP•15mo ago
Thank you for your message but i think i will wait unitl native windows installer is out i think then i will be able to build for windows
Want results from more Discord servers?
Add your server