# How to compile C++ application on XCode for Windows?



## kzez1986 (May 22, 2006)

I use Mac OS X 10.4.4 for Intel. I write c++ program in XCode I would like to compile it for Windows. Is it possible and how to do it?


----------



## lurk (May 22, 2006)

It is possible but very hard and it depends on what level of windows support you need.   BAsically you need to look into installing a cross compiler for windows that runs under OS X you also will need to get ahold of the needed header files.  Look at something like mingw for a feel of what is involved.  

New me, I don't need that much grief, so I would not try it myself.

-Eric


----------



## ra3ndy (May 22, 2006)

From this link:


> You can find some info on setting up Xcode to cross-compile to Win32, using MinGW, at http://www.zonic.co.uk/products/mingw/.



Hopefully that'll have some useful info for you.


----------



## Krevinek (Jun 13, 2006)

Other than the link given... there is likely no real hope of using XCode for Windows programming. The issue isn't compilers (for the most part), it is libraries, and file formats. MacOS X uses a different set of libraries which aren't present on Windows, and vice versa. MacOS X uses a different executable format, and a different dynamic linker in its runtime. 

You would need a copy of Visual Studio most likely to get the libs needed, and a compiler that was aware of Windows' library/executable formats. Then you might have a chance at doing it... but at that point you already have a copy of Visual Studio, and should just use that on an Intel Mac running XP or a PC. 

Or if you aren't stuck with just C++, you /could/ try using Java for it.


----------

