在 Ubuntu 上安装 MingW-W64 交叉编译环境[转]

I contacted Pali, who was kind enough to provide a better solution (https://bugs.launchpad.net/ubuntu/+source/gcc-mingw32/+bug/568028):

Download the newer packages from the mingw-packages ppa repository (these are not only for karmic, they work on maverick, too):

wget http://ppa.launchpad.net/mingw-packages/ppa/ubuntu/pool/main/w/w64-toolchain/i686-w64-mingw32-toolchain_1.0b+201011211643-0w2273g93970b22426p16~karmic1_amd64.deb
wget http://ppa.launchpad.net/mingw-packages/ppa/ubuntu/pool/main/w/w64-toolchain/x86-64-w64-mingw32-toolchain_1.0b+201011211643-0w2273g93970b22426p16~karmic1_amd64.deb

Make sure you choose the correct architecture for your system (amd64/i386)!

Install some dependencies:

sudo apt-get install libcloog-ppl0 libgmpxx4ldbl libmpfr1ldbl libppl-c2 libppl7

Finally install the downloaded packages:

dpkg -i i686-w64-mingw32-toolchain_1.0b+201011211643-0w2273g93970b22426p16~karmic1_amd64.deb
dpkg -i x86-64-w64-mingw32-toolchain_1.0b+201011211643-0w2273g93970b22426p16~karmic1_amd64.deb

Enjoy your new compilers like this:

i686-w64-mingw32-gcc main.cpp -o main.exe
i686-w64-mingw32-g++ main.cpp -o main.exe
x86_64-w64-mingw32-gcc main.cpp -o main.exe
x86_64-w64-mingw32-g++ main.cpp -o main.exe




Related posts

coded by nessus

发表评论