Compiling for Mac/Linux on Windows

你离开我真会死。 提交于 2020-01-04 09:13:25

问题


Obviously you can't really run Mac or Linux apps on Windows, but can you compile binaries for those platforms using MSVC++ for example (plugging in additional compilers and tools obviously)? For a serious build system, you don't want one build server per platform so having an automated build server which compiles for all target platforms seems quite a reasonable aim.


回答1:


Crosstool-NG seems like your best option for Linux apps; they show that as one of the standard configurations. I do not know about Mac OS X; this question suggests that it will probably be difficult.




回答2:


I would like to believe (notice my careful words) that GCC can be built to run on windows (any relevant form of the triplet --mingw*) and target another triplet.

A proof-of-concept for the non-believers is provided here, where you can find Win64 hosted compilers that build native linux binaries. I assume the same can be done for mac if the necessary libraries (like the CRT and necessary Mac framework libraries) can be built/used by that compiler.




回答3:


if you want to build applications using C++, why not use Qt from Nokia. it's cross platform. http://qt.nokia.com/



来源:https://stackoverflow.com/questions/4984609/compiling-for-mac-linux-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!