mac for windows交叉编译

发布于 2024-12-09 08:53:04 字数 112 浏览 3 评论 0原文

我可以在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽梦忆笙歌 2024-12-16 08:53:04

这些说明适用于 MacOS 和 Linux,但我将从 Mac 的角度提供它们。

  1. 下载 Docker
  2. 添加 Windows dockcross

如果您不知道如何使用 docker,那么只需下载 Kitematic< /a> (链接到外部 地点。)。

在 Kitematic 中,您只需单击“+New”按钮即可从 docker hub 获取dockcross 镜像。

在 Kitematic 中下载镜像后,单击左下角的“Docker CLI”按钮。这将为 docker 环境打开一个新的终端窗口设置。

从该终端窗口:

cd 到包含要构建的项目的目录,然后保存将运行 docker 容器并构建项目的 shell 脚本:

  1. docker run --rm dockcross/windows-x86 > ./dockcross
  2. chmod +x ./dockcross
  3. ./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.

  1. Download Docker
  2. Add a Windows dockcross

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:

  1. docker run --rm dockcross/windows-x86 > ./dockcross
  2. chmod +x ./dockcross
  3. ./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

情绪 2024-12-16 08:53:04

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文