Can I create a a windows executable from my c++ source code on my mac?

Discussion in 'Mac Programming' started by DUMBDOG, Jan 16, 2009.

  1. DUMBDOG macrumors newbie

    Joined:
    Oct 29, 2008
    #1
    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.
     
  2. Menge macrumors 6502a

    Menge

    Joined:
    Dec 22, 2008
    Location:
    Amsterdam
    #2
    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
     
  3. newb16 macrumors regular

    Joined:
    Feb 27, 2008
    #3
    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
     
  4. Krevnik macrumors 68040

    Krevnik

    Joined:
    Sep 8, 2003
    #4
    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?
     
  5. DUMBDOG thread starter macrumors newbie

    Joined:
    Oct 29, 2008
    #5
    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.

    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
     

Share This Page