I'm using Fedora 29, and I've been happily using sublime text to compile/build and run C++ code that runs on this machine.
I now realize that the compiled program is not portable. It will only run on Linux. It won't run on Mac or Windows.
After some research, I found out that Mac uses a different format than Linux does. This info was backed up after repeating the experiment as well as compiling the same source code on Mac (which worked fine).
Question
Is there a way to use sublime text on Linux to compile code (C++ or other) that will run on other operating systems (i.e MacOS and Windows). I do not mind compiling the code 3 times, one for Windows, one for Mac, and one for Linux.
Notes
Note1: I want the code to be compiled in C++11!
Note2: I have already added the C++11 build, and have been using it.
Edit
My post is different from this question here, because I already know why I need to compile in different formats, therefore that is not my question. My question is "how can I do this in sublime text?" or, if that is not possible, "is there an app that will let me do this without leaving my OS?" Thanks in advance! PS: I do not mind compiling the code 3 times, one for Windows, one for Mac, and one for Linux.
Why do we need to compile for different platforms (e.g. Windows/Linux)?