开发者

how do I install both mingw32 and mingw64 on Linux or MacOS?

I'm 开发者_JS百科having trouble installing both mingw32 and mingw64 on Linux or MacOS. I've tried many different package repositories and multiple versions of Linux. I'm happy to use anything.

Thanks.


On Ubuntu, you can get going in many cases with "apt-get install gcc-mingw32"

If you need to install both the 64-bit and 32-bit mingw compilers, try this:

  • from http://sourceforge.net/tracker/?func=detail&aid=3258887&group_id=67079&atid=516781

For 64-bit build systems:

apt-get install libmpfr1ldbl
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
dpkg -i x86-64-w64-mingw32-toolchain_1.0b+201011211643-0w2273g93970b22426p16~karmic1_amd64.deb

For 32-bit build systems:

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
dpkg -i i686-w64-mingw32-toolchain_1.0b+201011211643-0w2273g93970b22426p16~karmic1_amd64.deb

Source for this tip: http://ubuntuforums.org/showthread.php?t=1705566

On Fedora, you can install mingw32 using standard yum. To install mingw64, follow the instructions at:

  • http://fedoraproject.org/wiki/MinGW/CrossCompilerFramework
  • http://fedoraproject.org/wiki/Features/Mingw-w64_cross_compiler
  • http://www.advancedhpc.com/tower_servers/tower_server_products.html

    $ cd /etc/yum.repos.d $ sudo wget http://fedoraproject.org/wiki/MinGW/CrossCompilerFramework#Development_and_testing_repository $ yum update $ yum install mingw64-gcc mingw64-g++ mingw64-zlib

Best bet for cross-compiling seems to be Fedora, which gives you both mingw32 and mingw64:

  • http://fedoraproject.org/wiki/MinGW/CrossCompilerFramework

    sudo yum install mingw32-gcc-c++

I haven't been able to find a 64-bit cross-compiler for Mac.


Fedora has a very nice mingw32 cross compiler framework with lots of pre-compiled libraries. The packages are all included in the official package repository and it's just the matter of running 'yum install mingw32-gcc' to set the compiler up. See the Fedora MinGW project page for more information.

However, the official packages currently only support the 32 bit Windows target. To lift that restriction, there is work underway and a temporary repository set up with mingw32, mingw64, and OS X cross compilers. See https://fedoraproject.org/wiki/MinGW/CrossCompilerFramework for more info.


I take it you want to cross-compile to both win32 and win64. Current Debian testing can help you there with the gcc-mingw-w64 package. Drawback is that shared gcc libraries (=> cross-DLL exception support etc.) is currently disabled.


Fedora has now put mingw32 and mingw64 in the main release. This script will nicely install everything needed:

MPKGS="autoconf automake gcc gcc-c++ osslsigncode mingw32-nsis flex wine zlib-devel wget md5deep git "
MPKGS+="mingw32-gcc mingw32-gcc-c++ mingw32-zlib mingw32-zlib-static mingw32-libgnurx-static mingw32-boost mingw32-boost-static "
MPKGS+="mingw64-gcc mingw64-gcc-c++ mingw64-zlib mingw64-zlib-static mingw64-libgnurx-static mingw64-boost mingw64-boost-static"

if [ ! -r /etc/redhat-release ]; then
  echo This requires Fedora Linux
  exit 1
fi

if grep 'Fedora.release.' /etc/redhat-release ; then
  echo Fedora Release detected
else
  echo This script is only tested for Fedora Release 17 and should work on F17 or newer.
  exit 1
fi

echo Will now try to install 

sudo yum install -y $MPKGS
if [ $? != 0 ]; then
  echo "Could not install some of the packages. Will not proceed."
  exit 1
fi

echo 
echo "Now performing a yum update to update system packages"
echo yum -y update
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜