View Full Version : Can I create a a windows executable from my c++ source code on my mac?
DUMBDOG
Jan 16, 2009, 04:11 PM
The title pretty much says it all. I am taking a graphics course (OpenGL) at my College and the requirement for all projects is to turn in all source code, along with a windows executable file to run the program (my professor uses windows). So is there any way to create the .exe file to run on a windows box, from my mac? currently I am trying to learn, (and growing fond of) using vi and gcc for my programming needs and do want to switch to MSVS to write all my projects for the class. So is there any help? any command line options I can use with gcc, or something of that sort?
I have bootcamp installed on my laptop and can get a copy of MSVS from my school, but that would just be a real hassle.
Menge
Jan 16, 2009, 04:21 PM
i think you'll need to install Windows to build it. I Googled around and couldn't find how to build a Windows executable from within OS X
newb16
Jan 16, 2009, 04:54 PM
I have bootcamp installed on my laptop and can get a copy of MSVS from my school, but that would just be a real hassle.
There are mingw and cygwin, a gcc compiler with library and (most) headers that runs under windows and generate win32 executable. One probably can make cross-platform gcc hosted on macos and targeted on windows, but in such situation I'd rater use bootcamp or rent amazon ec2 ($0.125 per hour)
ETA
googled for:cross compile mac os windows
4th link is to the forum post on idevgames, then link in post, did not check it.
http://www.apple.com/downloads/macosx/development_tools/crosscompilerforwin32.html
Krevnik
Jan 16, 2009, 06:23 PM
I'd say do it under Windows as well. Either in a VM or through Bootcamp. Otherwise you are left without an environment to test in, so how do you know your code works?
DUMBDOG
Jan 17, 2009, 12:41 AM
I'd say do it under Windows as well. Either in a VM or through Bootcamp. Otherwise you are left without an environment to test in, so how do you know your code works?
to figure out if it works I could just compile it to a Unix executable, and then run it. if it works correctly, then use the windows compiler and linker to create the .exe.
There are mingw and cygwin, a gcc compiler with library and (most) headers that runs under windows and generate win32 executable. One probably can make cross-platform gcc hosted on macos and targeted on windows, but in such situation I'd rater use bootcamp or rent amazon ec2 ($0.125 per hour)
ETA
googled for:cross compile mac os windows
4th link is to the forum post on idevgames, then link in post, did not check it.
http://www.apple.com/downloads/macosx/development_tools/crosscompilerforwin32.html
your link looks very promising. from the description it looks like exactly what im looking for. ill check it out and see if it suites my needs. Thanks
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.