About .exe files. How to make them run outside VS Code

Hello, everyone!
I’ve started the Unreal C++ course and since I’m new to learning code, I tought I’d try to learn some basic C++ before going too deep into Unreal. So, as I am reading Tony Gaddis’ “Starting Out With C++” I’ve tried doing some of the excercises and I realised that I can’t compile my brand new code. After I downloaded the g++ compiler and everything (it works fine), I’ve tried running the .exe file which VSCode has created. My .exe file doesn’t run, unless I do it from VSCode’s terminal, but the one from the TripleX game (the one that was with the course) runs everytime I double-click on the .exe file and opens a terminal.
My question is: why does the TripleX.exe work when I double click it and why does my .exe file not?

Is this normal Windows behaviour? Does it affect the file at all? How can I share my “games” with my friends if they can’t run the .exe?

I managed to figure it out. It seems the .exe file was opening and closing quickly. I added a

cin

line and now it’s stopping so I can see it run.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.