Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

djcraze

macrumors regular
Original poster
Jul 3, 2007
169
140
I'm taking a C++ class for my Computer Science degree.. and of course my instructor wants me to compile for Windows. Is there a program that can do this? (I don't want to use CrossOver or VMWare, etc)

Thanks!
 
Depends on the APIs. If you're sticking with mostly open source or POSIX based APIs you may be able to setup a MinGW environment from source so you can cross-compile to a Windows executable which, in my opinion, is going to be more trouble than it's worth. If you are going to be using Windows APIs then you really have no choice; you will need to use an actual Windows install. In either case, it may be a wise idea to check with your IT department as they may be licensed to give you a key for Windows and the Visual Studio SDK. At that point you can either download VirtualBox and run a VM or just install Windows via Bootcamp (both are free options).
 
it has nothing to do with Windows APIS :). its VERY basic C++. Beginners. I could easily compile the stuff were doing for OSX.

I'm compiling basic .cpp files..
 
it has nothing to do with Windows APIS :). its VERY basic C++. Beginners. I could easily compile the stuff were doing for OSX.

So it's just command-line stuff. Your professor will probably want your code itself and not the finalized compiled program. At least mine didn't. I was able to write and compile (to check integrity) with Xcode and just submit the C++ file straight off. If he wants the final compiled program... that's not good teaching, really.
 
I agree, I think he wants both though. To be honest I'm not 100% sure. He has yet to upload the assignments to evil blackBoard. Eitherway, lets assume he wants them both.
 
Do you have access to a computer lab with Windows machines? They'd probably have Visual Studio or Cygwin and GCC. In that case, just write your assignment on your Mac, then, before you hand it in, compile and test it on a lab machine.

When I took C courses in college, even though our assignments were simple command-line programs, we had to make sure they worked on Windows, Linux, and Solaris. It's always good to be safe--there are some extremely subtle cross-platform differences that could bite you in the, um, rear. :p
 
I'm taking a C++ class for my Computer Science degree.. and of course my instructor wants me to compile for Windows. Is there a program that can do this? (I don't want to use CrossOver or VMWare, etc)

Thanks!

If your objection to CrossOver is the cost and not the concept, you can always use Wine (http://www.winehq.org) which is the open source project CrossOver is based off of. You'll probably want either macports or fink to install it since they don't make Mac binaries.
 
I'm taking a C++ class for my Computer Science degree.. and of course my instructor wants me to compile for Windows. Is there a program that can do this? (I don't want to use CrossOver or VMWare, etc)

Thanks!

Can't you just ask him? Like "I have a Macintosh with XCode. How do you think I should compile for Windows? "
 
I'm taking a C++ class for my Computer Science degree.. and of course my instructor wants me to compile for Windows. Is there a program that can do this? (I don't want to use CrossOver or VMWare, etc)

Once there was a 'crosscompilerforwin32' page on apple.com/downloads, that was a mingw hosted on mac os, but it's no longer available.
 
You can try this if you want to setup a cross compiler environment on your mac. It's mingw built for a mac.

I'd ask your teacher exactly what he wants. If he wants a windows binary, does he care how you built it (Visual Studio, cygwin/gcc, mingw)? Personally, I'd setup mingw & msys under windows inside a VM. I'd do all the development/testing/debugging on my mac and then build it and test it on windows just to make sure it does work on it.
 
I've just checked and you can't run Visual Studio on Wine, so I suggest you get a PC to do the final code test, or use a PC in the lab.
 
Mate I would suggest using a VM to install Windows, and do your coding from there. Though it may be very basic C++, you may still need access to windows header files (windows.h) etc.

:apple: KrayzieKray :apple:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.