mac for windows交叉编译
我可以在 mac 上编译以便生成 Windows 二进制文件吗?与windows dll 绑定吗? (我有一台 Windows 机器可以从中复制它们)我该怎么做? clang 和 gcc 是我可以使用的编译器。
Can I compile on mac so it will produce a windows binary? bind with windows dlls? (I have a windows machine to copy them from) How can I do so? clang and gcc are the compilers I can use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些说明适用于 MacOS 和 Linux,但我将从 Mac 的角度提供它们。
如果您不知道如何使用 docker,那么只需下载 Kitematic< /a> (链接到外部 地点。)。
在 Kitematic 中,您只需单击“+New”按钮即可从 docker hub 获取dockcross 镜像。
在 Kitematic 中下载镜像后,单击左下角的“Docker CLI”按钮。这将为 docker 环境打开一个新的终端窗口设置。
从该终端窗口:
cd 到包含要构建的项目的目录,然后保存将运行 docker 容器并构建项目的 shell 脚本:
chmod +x ./dockcross
./dockcross make
(假设您的项目使用 makefile)有关更多示例和进一步指导,请参阅dockcross 文档。
ockcross 使用 MXE,因此您可以轻松构建大多数项目,但您可能需要安装额外的 MXE 软件包
These instructions will work on both MacOS and Linux, but I will provide them from a Mac perspective.
If you don't know how to use docker then just download Kitematic (Links to an external site.).
From Kitematic you can simply click the "+New" button and get the dockcross image from the docker hub.
After the image downloads in Kitematic, click the "Docker CLI" button in the bottom left. This will open a new terminal window setup for the docker environment.
From that terminal window:
cd to the directory with the project you want to build then save a shellscript that will run the docker container and build the project:
docker run --rm dockcross/windows-x86 > ./dockcross
chmod +x ./dockcross
./dockcross make
(assuming your project uses a makefile)See the dockcross documentation for more examples and further guidance.
dockcross uses MXE, so you can pretty easily build most projects, but you may need to install additional MXE packages
MinGW 的工具链可以构建在 OSX 或大多数其他 UNIX/类 UNIX 操作系统上。
以下是预编译二进制文件的链接: http://crossgcc.rts -software.org/doku.php?id=mingw-older-releases
它在我的 PowerMac G5 上运行良好,正如 keith.layne 所说,还有一个适用于 Intel Mac 的解决方案。
The MinGW's toolchain can be built on OSX or most other unix/unix-like operating systems.
Here's a link to the precompiled binaries: http://crossgcc.rts-software.org/doku.php?id=mingw-older-releases
It works fine on my PowerMac G5 and as keith.layne says there is also a solution for Intel Macs.