MinGW Step by Step

原创 2007年10月05日 22:42:00

 

reference
 www.mingw.org
http://www.mingw.org/MinGWiki/
下载 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用作迅雷的下载列表
http://www.mingw.org/download.shtml
里面有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
。。。。。。
但有无效连接
http://sf.net/project/showfiles.php?group_id=2435
进行修改
完整的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的安装,配置见这个网页
http://www.mingw.org/MinGWiki/index.php/RealDumbQuickstart
 
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!

 

 

 

相关文章推荐

kubernetes1.4 基础篇:Learn Kubernetes 1.4 by 6 steps(6):Step 5. Scale Your App

在上一篇文章中了解到了kubernetes中的lable和两个概念, 并使用kubectl创建了sonarqube的应用, 在这篇文章之中我们将学习到如何在kubernetes中进行扩展....

kubernetes1.4 基础篇:Learn Kubernetes 1.4 by 6 steps(5):Step 4. Expose Your App Publicly

在上一篇文章中我们了解了如何在kubectl get/describe等确认进一步的信息以进行故障排除等,本文我们将围绕kubernetes中的lable和service两个概念展开。...

kubernetes1.4 基础篇:Learn Kubernetes 1.4 by 6 steps(7):Step 6. Update Your App

在上一篇文章中了解到了如何在kubernetes中进行扩展, 本篇文章中我们将要学习到如何使用kubernetes进行Rolling update。...

kubernetes1.4 基础篇:Learn Kubernetes 1.4 by 6 steps(2):Step 1. Create a Kubernetes cluster

在本文中我们将会将会学到如何利用kubeadm快速创建集群, 和google的官方教程气提供的交互式minikube不同,我们将会创建一个真正的由3个node和一个master构成的k8s的几乎最小的...

Archie OSGStep By Step② 写入OSG场景图形到文件(从文件读取OSG场景图形)

在第一课基础之上修改代码,其实仅需要增加两句话即可。也就是这两句 bool result = osgDB::writeNodeFile(*(root.get()),"Simple.osg"); ...
  • whucv
  • whucv
  • 2013年01月01日 20:01
  • 1469

kubernetes1.4 基础篇:Learn Kubernetes 1.4 by 6 steps(3):Step 2. Using kubectl to Create a Deployment

在上一篇文章中我们学习到了如何快速搭k8s的集群。本文将会将会学到Kubernetes的应用部署(Deployment),以及如何使用kubectl来部署我们的应用。被部署的应用我们将直接使用kube...

asp.net 4.0 step by stem

  • 2010年05月16日 22:14
  • 9.18MB
  • 下载

Step by Step,用JAVA做一个FLAPPYBIRD游戏(六)

这一篇来实现结束界面。 还是先上代码。public class overMenu { private final Image IMG_OVER = new ImageIcon("images/...
  • smtctc
  • smtctc
  • 2017年01月21日 17:27
  • 438

微软出版社的WCFstep by step

  • 2007年10月16日 20:04
  • 9.73MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:MinGW Step by Step
举报原因:
原因补充:

(最多只允许输入30个字)