(リリースされたばかりの)gcc-4.4.0に基づく64ビットのMinGWは、おそらく最善の策です。(sourceforge.netのmingw-w64プロジェクトはmingw-w64.orgに移行しているため、mingw-w64.orgを使用することをお勧めします)
詳細な手順: 1。アーカイブ
を
ダウンロードします
。2。cygwinの下のどこかに解凍します。私の場合、最上位のcygwinディレクトリはです。パッケージをディレクトリに抽出し、次の内容になりました( cygwinの下に表示されます。
C:\cygwin
mingw
C:\cygwin\mingw
/mingw
$ ls -l /mingw
total 1
drwxr-xr-x+ 2 user None 0 May 10 08:32 bin
drwxr-xr-x+ 2 user None 0 May 10 05:45 include
drwxr-xr-x+ 2 user None 0 May 10 08:30 info
drwxr-xr-x+ 3 user None 0 May 10 08:30 lib
drwxr-xr-x+ 3 user None 0 May 10 05:45 libexec
drwxr-xr-x+ 4 user None 0 May 10 05:45 man
lrwxrwxrwx 1 user None 17 May 17 17:20 mingw -> x86_64-pc-mingw32
drwxr-xr-x+ 3 user None 0 May 10 04:16 share
drwxr-xr-x+ 5 user None 0 May 10 04:18 x86_64-pc-mingw32
3.次に、いくつかのC++コードをコンパイルします。私が使用した:
// t.cc
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> vs;
vs.push_back("abc");
}
そして、次のようにコンパイルします。
$ /mingw/bin/x86_64-pc-mingw32-g++ t.cc
4.最後に、次を実行して、結果がWindows /x64実行可能ファイルであることを確認しますdumpbin /headers a.exe
。
Microsoft (R) COFF/PE Dumper Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file a.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
8664 machine (AMD64)
10 number of sections
4A10AF9F time date stamp Sun May 17 17:45:19 2009
ABA00 file pointer to symbol table
EC4 number of symbols
F0 size of optional header
27 characteristics
Relocations stripped
Executable
Line numbers stripped
Application can handle large (>2GB) addresses