ソフト | Select Packages | コマンド名 | |
---|---|---|---|
g++ | Devel | linux-x86_64-gcc-g++ | /usr/bin/x86_64-pc-linux-gnu-g++ |
|
Cygwin上でコンパイルしてLinux用バイナリーを生成する(クロスコンパイルする)には、Linux向けコンパイラー(gcc, g++等)を使用する。
標準的なCygwinのダウンロードサイトからはLinux向けコンパイラーはダウンロードできないので、cygwinports.orgからダウンロードする。
Linux向けコンパイラー(gcc, g++)をインストールする方法。
> cd /d D:\arc\cygwin > setup-x86_64.exe -K http://cygwinports.org/ports.gpg
Cygwinのコンソール(bash)からコンパイラーを実行し、インストールされたことを確認する。
$ x86_64-pc-linux-gnu-gcc --version x86_64-pc-linux-gnu-gcc (GCC) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ x86_64-pc-linux-gnu-g++ --version x86_64-pc-linux-gnu-g++ (GCC) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.