Is it possible to compile C++ code to .exe on a Mac?

I bought a pre-owned Macbook a little while ago and I've been coding inside Sublime Text 2 and compiling in Terminal with g++*. I wrote a stupid text adventure that I'd like to send to a friend and if possible, I'd like to know if there are any methods available on Mac of compiling to exe similar to the way I've been compiling my code (i.e. solely with terminal).

I understand that the easy solution would be to just compile the .cpp file on a Windows computer but my computer is all the way over at the other side of the room.

Thanks.

*Doing this due to being on Snow Leopard and being too tight to buy OSX Lion or an Apple developer license to access Xcode. If anyone has encountered the same problem then I found this solution on here ( https://github.com/kennethreitz/osx-gcc-installer and http://cims.clayton.edu/csci1301/how_to/compiling_c_on_a_mac.htm). Allows you circumvent the bullshit of Apple.

Answers


Yes, it is possible and it's known as cross-compilation. Besides building your own toolchain for doing this, you can use MinGW: Cross compiling with MinGW


Need Your Help

Modify XML node but keep the XML file format intact

java xml

How may I modify a XML file without any change like attributes ordering, tag expansion and encoding? (My preference is DOM API)

Django modify POST and pass on to next view

django post

In my Django webapp, I have a user submit data to Form1.html. The data is passed onto Form2.html where they submit more data. After they submit Form2 they are taken to Done.html.