使用 MinGW (Dev-C++) 编译 64 位二进制文​​件 [英] Compile 64-bit binary with MinGW (Dev-C++)

查看:40
本文介绍了使用 MinGW (Dev-C++) 编译 64 位二进制文​​件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但我从大约 3 小时开始寻找答案.

It is probably a stupid question but i was searching for the answer from about 3h.

¿如何使用 (Dev-C++) MinGW 编译 64 位二进制文​​件?

我已阅读 MinGW 默认支持 64 位,但我无法激活此选项.

I have readed that MinGW support 64bits by default, but i am unable to active this option.

我尝试过-m64",但它说:抱歉,未实现:64 位模式未编译"

I have tryed "-m64" but it say: "sorry, unimplemented: 64-bit mode not compiled in"

我正在 Windows-7 上开发 Dev-C++

I am working on Dev-C++ on Windows-7

我知道如何在 MSVC++ 上执行此操作,但我不想要 MSVC++(出于道德问题)

I know how to do it on MSVC++, but I don't want MSVC++ (cause of ethical issues)

我正在尝试编译的内容,仅用于测试目的:

What i am trying to compile, just for testing purpose:

#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{   
    // Test compiling mode
    if (sizeof(void*) == 8) cout << "Compiling 64-bits" << endl;
    else cout << "Compiling 32-bits" << endl;

    return 0;
}

推荐答案

要在 Windows 上构建 64 位二进制文​​件,您需要 64 位版本的 mingw 编译器.Mingw-W64 是您可以使用的一种可能的发行版.您可以在此处找到下载列表.

To build a 64-bit binary on windows you need the 64-bit version of the mingw compiler. Mingw-W64 is one possible distribution you can use. You can find a list of downloads here.

此外,您还可以在 Orwell Dev-C++ 下找到与 mingw 64 位编译器捆绑在一起的 Dev-C++ 设置 的下载部分.确保您选择TDM-GCC x64 4.7.1"设置或便携.

Additionally, you can also find Dev-C++ setup bundled with mingw 64-bit compiler under Orwell Dev-C++'s download section. Make sure you choose "TDM-GCC x64 4.7.1" either setup or portable.

这篇关于使用 MinGW (Dev-C++) 编译 64 位二进制文​​件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆