编译64位二进制MinGW的(开发 - C ++) [英] Compile 64-bit binary with MinGW (Dev-C++)

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

问题描述

这可能是一个愚蠢的问题,但我正在寻找答案的约3小时。

¿如何编译64位二进制(开发 - C ++)的MinGW?

我已经readed是MinGW的支持64位默认,但我无法激活此选项。

我已经tryed-m64,但它说:对不起,没有实现:64位模式不是在编

我工作的开发 - C ++在Windows 7

我知道如何做到这一点的MSVC ++,但是我不希望MSVC ++(伦理问题的原因)

我试图编译,只是为了测试目的:

 的#include<的iostream>
使用名字空间std;

INT主(INT ARGC,字符* argv的[])
{
    //测试编译模式
    如果(的sizeof(无效*)== 8)COUT<< 编译64位<< ENDL;
    否则COUT<< 编译32位<< ENDL;

    返回0;
}
 

解决方案

要在Windows上构建一个64位二进制需要64位版本的MinGW的编译器。 MinGW的-W64是一种可能的分布就可以使用。你可以找到的 下载这里

名单

此外,你还可以找到开发-C ++安装在 奥威尔开发-C ++ <捆绑的MinGW 64位编译/ STRONG>的下载区。确保你选择的 TDM-GCC 4.7.1 64 的要么设置或便携式。

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

¿How to compile 64-bit binary with (Dev-C++) MinGW?

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

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

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

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;
}

解决方案

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.

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.

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

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