Way Cross编译C/C ++代码以在Windows,Linux和Mac OS上运行? [英] Way Cross Compile C/C++ code to run on Windows, Linux, and Mac OS?
问题描述
是否可以获取我的C ++代码并交叉编译以在Windows,Mac OS和Linux上运行?是否有工具可以执行此操作,还是必须在每个操作系统上通过Terminal/Cygwin手动对其进行编译?
Is there a way to take my C++ code and cross compile it to run on Windows, Mac OS, and Linux? Is there a tool to do this, or does it have to be manually compiled on each OS via Terminal/Cygwin?
推荐答案
您可以使用所谓的交叉编译器进行交叉编译. Mingw可以这样安装.我相信MacOS只是使用g ++,因此您可能也可以为其编写交叉编译器.我自己从来没有做过.您可以在网上搜寻路线.这是我从Google那里获得的最重要的链接:
You can cross compile with what is known as a cross-compiler. Mingw can be installed as such. I believe MacOS just uses g++ so you can probably make a cross compiler for it as well. Never done it myself. You can scour the web for directions. Here's the top link I got from google:
http://linux.bytesex.org/cross-compiler.html
这篇关于Way Cross编译C/C ++代码以在Windows,Linux和Mac OS上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!