问题
I have a small console based, standards compliant, C++ program that I developed in Visual Studio on Windows. Since it is in standard C++, is all I need to do is compile it for OSX? or am I being overly optimistic?
I am looking for the easiest and most straightforward way to do this. Is it possible to do from Visual Studio 2012 Professional? If necessary I have access to a Mac. However, since my dev platform is Windows, it would be nice if I could do it from here.
I'm not experienced with mac development at all. When you compile an application for OSX, what do you get instead of a .exe?
回答1:
I would get an OSX system (a VM is fine), install XCode and then compile your code using that. Should be trivial if your C++ code is written in a cross platform way.
回答2:
If you don't mind installing MinGW or Cygwin to your Windows machine, you can build a Windows to OS X cross-toolchain as per the instructions here: https://github.com/Tatsh/xchain
来源:https://stackoverflow.com/questions/12544457/compiling-c-for-osx-from-windows