OnlineGDB does not provide you with the executable. It only runs on a server and you can see the output.
If you want to have the compiled program, you have to build on a machine where you have access to the build artifacts (e.g. your own PC, school computer, etc).
Of course you'll have to make sure you have the desired compiler available on this machine.
This may help too.