MinGW Step by Step

 

reference
下载 mingw-x.x.x.exe
运行
取消
阅读mingw.ini(用写字板)
有片段
[current]
runtime=mingw-runtime-3.13.tar.gz|5420
w32api=w32api-3.10.tar.gz|14490
binutils=binutils-2.16.91-20060119-1.tar.gz|15850
core=gcc-core-3.4.2-20040916-1.tar.gz|8627
gpp=gcc-g++-3.4.2-20040916-1.tar.gz|16542
g77=gcc-g77-3.4.2-20040916-1.tar.gz|5158
ada=gcc-ada-3.4.2-20040916-1.tar.gz|33333
java=gcc-java-3.4.2-20040916-1.tar.gz|45547
objc=gcc-objc-3.4.2-20040916-1.tar.gz|4555
make=mingw32-make-3.81-2.tar.gz|720
看出该下载什么文件
编辑downlod.lst用作迅雷的下载列表
里面有mirror
http://gd.tuwien.ac.at/gnu/mingw/
于是
downlod.lst
http://gd.tuwien.ac.at/gnu/mingw/ mingw-runtime-3.13.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/ w32api-3.10.tar.gz
。。。。。。
但有无效连接
进行修改
完整的downlod.lst
http://nchc.dl.sourceforge.net/sourceforge/mingw/mingw-runtime-3.13.tar.gz
http://nchc.dl.sourceforge.net/sourceforge/mingw/w32api-3.10.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/binutils-2.16.91-20060119-1.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/gcc-core-3.4.2-20040916-1.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/gcc-g++-3.4.2-20040916-1.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/gcc-g77-3.4.2-20040916-1.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/gcc-ada-3.4.2-20040916-1.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/gcc-java-3.4.2-20040916-1.tar.gz
http://gd.tuwien.ac.at/gnu/mingw/gcc-objc-3.4.2-20040916-1.tar.gz
http://jaist.dl.sourceforge.net/sourceforge/mingw/mingw32-make-3.81-2.tar.gz
用迅雷导入就行
Msys和MinGW的安装,配置见这个网页
 
Real Dumb Quickstart
Intro
 
This is a fast step-by-step guide to getting MinGW up and running on your windows box, to save you the pain and frustration I suffered.
 
(If you're not as impatient as I, you can find an older and more detailed guide at GettingStarted.)
Dumber Than Dumb, Faster Than Fast
 
Except you can just fetch just a MinGW exe and an MSYS exe, run those, edit your PATH, and go, ...
 
... if you're only trying to add gcc and g++ and a few Unix tools like grep and vi to your Windows Cmd.exe shell.
 
For example, on 2005-12-20, the mingw.org Download page had a File List, and that list was not empty if you waited enough seconds to see it. Then in that list you could find "Current" "MSYS-1.0.10.exe" and "Proposed" "MinGW-5.0.0.exe". Running that MinGW on an Internet-connected Windows (yuck) and choosing the 'Download only' rather than 'Download as needed and install' constructed a "Current" monolithic installer in a local folder for you. Copy that folder to a Windows machine, run both installers, remember to again explicitly ask MinGW for g++, and hey presto you have gcc g++ vi etc. etc. on that Windows machine too.
 
But if you're ready to get more involved, then:
Background
 
I've been writing a lot of Python code for Linux and Windows, using gcc to build my extensions on the Linux side, and msvc6 to build them on the windows side.
 
This worked great, till Python 2.4. This Python is built with MSVS .Net 2003, a whole different compiler, so my old trusty msvc6 just doesn't cut it any more. I tried the free command-line MS compiler toolchains, both the 'MS Visual Studio 2003 Toolkit' and the 'Visual Studio SDK'. Unfortunately, neither of these worked because Python2.4 needs stuff, such as headers, not available in those free compilers.
 
Getting MSVS .Net 2003 is not an option for me, financially speaking, so I looked into MinGW.
MinGW Blues
 
As someone who likes to double-click on an exe or msi installer file, or type 'apt-get install something' on the linux side, I found the MinGW installation instructions a bit lengthy and scattered. Owing to my impatience, I tried 5 times to get the MinGW compiler and supporting tools set before I finally got it right.
About this document
 
I've written this document in a step by step fast walkthrough style, because this is what I best relate to personally, so at least some others might find it useful too.
Prerequisites
Go to the MinGW download page and download the following files from the 'Current' list (replacing the 'x.x.x' with the current version numbers)
MSYS-x.x.x.exe
msysDTK-x.x.x.exe
mingw32-make-x.x.x.exe
binutils-x.x.x.tar.gz
mingw-utils-x.x.x.tar.gz
mingw-runtime-x.x.tar.gz
w32api-x.x.tar.gz
gcc-core-x.x.x.tar.gz
gcc-g++-x.x.x.tar.gz
 
Don't crack the tarballs just yet. We'll do that in the next sections.
Installing MSYS and MinGW
Overview
 
First we have to install MSYS. Once that's done, we'll add the MinGW files.
 
MSYS is a clean, lightweight and user-friendly fork of cygwin that omits that infamous boat-anchor called 'cygwin.dll', and spares you of having to download and install Cygwin's considerable bloat.
 
MinGW runs within the MSYS environment, and gives you a pleasant unix-ish shell environment.
Install MSYS
Let's get MSYS installed, set up and running first. Follow these steps
run MSYS-x.x.x.exe, and accept the defaults
run msysDTK-x.x.x.exe, ditto
run mingw32-make-x.x.x.exe, ditto
run the MSYS shell (Start, Programs, MinGW, MSYS, msys)
Install MinGW
 
Congratulations, if you're seeing a shell window, then you've got the underlying MSYS working.
Now, within the MSYS shell
type cd /mingw to set your cwd to the mingw directory
copy all the above .tar.gz files into this directory
type the command: for i in `ls *.tar.gz`; do tar xfz $i; done
type ls /mingw to confirm that there is now a bunch of new directories in mingw, such as bin, include, lib, doc, info, lib, libexec, man
type cp -a /mingw/mingw32/* /mingw
 
It's crucial to crack the tarballs into /mingw (C:/msys/n.n/mingw), because if you crack any of them into / (C:/msys/n.n), you'll cause some subtle conflicts between MSYS and the MinGW tools which will cause your compilations to fail.
Test your installation
 
Type 'cd' into your MSYS shell, to go to your home directory. Using vi, or your favourite editor, create a file called 'temp.c' in that directory, containing just:
int main()
{
    return 0;
}
 
When that file is saved, type the command gcc temp.c.
 
If the command completes successfully, and produces a file called a.exe, then congratulations, your MinGW compiler environment is now working and ready to use.
 
Note - if, like me, you're into building Python extensions, then don't forget to check out the instructions in Python extensions.
 
Last edited on August 26, 2006 1:20 pm.
 
Have Fun!

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值