如何在 Linux 中将 .cpp 文件编译为 Windows 可执行 (.exe) 文件
我在 Ubuntu 上使用 Code::Blocks 用 C++ 编写了这个程序。我需要将其转换为 Windows 可执行二进制文件(.exe 文件),但我不知道如何执行此操作。是否可以?
I make this program in C++ using Code::Blocks on Ubuntu. I need to turn it into a Windows executable binary (.exe file), but I don't know how to do this. Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您的意思是在 Linux 上为 Windows 编译可执行文件,您可能会在此处。
If you meant, compiling an executable for Windows on Linux you might find some pointers on how to do that here.
GCC 和 Wine 的 MinGW32 发行版都应该可供您使用。
MinGW 有说明 和 winegcc 包装了 Wine 发行版附带的类似编译器。
我已经使用它们来编译 Windows 的应用程序和库。
Both the MinGW32 distribution of GCC and Wine should be available for your distribution.
MinGW has instructions and winegcc wraps a similar compiler that comes with the Wine distribution.
I've used both to compile both applications and libraries for Windows.
您可以阅读此处了解如何使用代码在 Linux 上为 Windows 编译 wxWidget 应用程序:: 块。
You could read here on how to compile wxWidget applications on Linux for Windows using Code::Blocks.
这是一个相当不寻常的问题。你问的是你想在Ubuntu上开发,但目标平台是Windows?
我的猜测是你有一个作业要交。我的信念是你应该去实验室编译它并确保它正常工作。
但是,进行一些研究后,您应该在 http://www.mingw.org/ 尝试 mingw
This is a fairly unusual question. What you're asking is that you want to develop on Ubuntu, but the target platform is Windows?
My guess is that you have an assignment to turn in. My belief is that you should go to a lab and compile it and make sure it's working.
However, doing some research, you should try mingw at http://www.mingw.org/